public PdfDocument(string baseUrl = null, PdfSettings settings = null) { Settings = settings ?? new PdfSettings(); BaseUrl = baseUrl ?? Environment.CurrentDirectory; // make sure baseUrl always ends with directory seperator if (!BaseUrl.EndsWith(Path.DirectorySeparatorChar.ToString())) { BaseUrl += Path.DirectorySeparatorChar; } }
public PdfDocument AddDocument(string baseUrl = null, Action <PdfSettings> settingsAction = null) { // copy settings from render var settings = new PdfSettings(Settings); settingsAction?.Invoke(settings); var doc = new PdfDocument(baseUrl, settings); Documents.Add(doc); return(doc); }
public PdfSettings(PdfSettings settings) { Username = settings.Username; Password = settings.Password; JSDelay = settings.JSDelay; WindowStatus = settings.WindowStatus; ZoomFactor = settings.ZoomFactor; BlockLocalFileAccess = settings.BlockLocalFileAccess; StopSlowScript = settings.StopSlowScript; DebugJavascript = settings.DebugJavascript; LoadErrorHandling = settings.LoadErrorHandling; Proxy = settings.Proxy; PrintBackground = settings.PrintBackground; LoadImages = settings.LoadImages; EnableJavascript = settings.EnableJavascript; EnableIntelligentShrinking = settings.EnableIntelligentShrinking; MinimumFontSize = settings.MinimumFontSize; PrintMediaType = settings.PrintMediaType; DefaultEncoding = settings.DefaultEncoding; UseExternalLinks = settings.UseExternalLinks; UseLocalLinks = settings.UseLocalLinks; ProduceForms = settings.ProduceForms; IncludeInOutline = settings.IncludeInOutline; PagesCount = settings.PagesCount; Orientation = settings.Orientation; ColorMode = settings.ColorMode; UseCompression = settings.UseCompression; DPI = settings.DPI; PageOffset = settings.PageOffset; Copies = settings.Copies; Collate = settings.Collate; OutlineDepth = settings.OutlineDepth; DumpOutline = settings.DumpOutline; DocumentTitle = settings.DocumentTitle; ImageDPI = settings.ImageDPI; CookieJar = settings.CookieJar; PaperSize = settings.PaperSize; Margins = new MarginSettings(settings.Margins); }