using System; using System.Threading.Tasks; using System.IO; using Elwig.Helpers; using System.Collections.Generic; using System.Text.RegularExpressions; using System.Linq; namespace Elwig.Documents { public abstract partial class Document : IDisposable { private TempFile? _pdfFile = null; private string? _renderedHtml = null; public bool ShowFoldMarks = App.Config.Debug; public string DataPath; public int CurrentNextSeason; public string? DocumentId; public string Title; public string Author; public string Header; public string Footer; public DateTime Date; public Document(string title) { var c = App.Client; DataPath = App.DataPath; CurrentNextSeason = Utils.CurrentNextSeason; Title = title; Author = c.NameFull; Header = $"
{c.Name}
{c.NameSuffix}
"; Footer = Utils.GenerateFooter("
", " \u00b7 ") .Item(c.NameFull).NextLine() .Item(c.Address).Item($"{c.Plz} {c.Ort}").Item("Österreich").Item("Tel.", c.PhoneNr).Item("Fax", c.FaxNr).NextLine() .Item(c.EmailAddress).Item(c.Website).Item("Betriebs-Nr.", c.LfbisNr).Item("UID", c.UstIdNr).NextLine() .Item("BIC", c.Bic).Item("IBAN", c.Iban) .ToString(); Date = DateTime.Today; } [GeneratedRegex(@".*?\s*", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled)] private static partial Regex GeneratedDocumentHeaderRegex(); private static readonly Regex DocumentHeaderRegex = GeneratedDocumentHeaderRegex(); [GeneratedRegex(@"