Esempio n. 1
0
 /// <summary>
 /// Sets up the supplied object config.
 /// </summary>
 /// <param name="config">config object pointer</param>
 /// <param name="prefix">property name prefix, must be either "header" or "footer"</param>
 internal void SetUpObjectConfig(IntPtr config, string prefix)
 {
     if (_fontSize != null)
     {
         PechkinBindings.wkhtmltopdf_set_object_setting(config, prefix + "." + "fontSize", _fontSize);
     }
     if (_fontName != null)
     {
         PechkinBindings.wkhtmltopdf_set_object_setting(config, prefix + "." + "fontName", _fontName);
     }
     if (_leftText != null)
     {
         PechkinBindings.wkhtmltopdf_set_object_setting(config, prefix + "." + "left", _leftText);
     }
     if (_centerText != null)
     {
         PechkinBindings.wkhtmltopdf_set_object_setting(config, prefix + "." + "center", _centerText);
     }
     if (_rightText != null)
     {
         PechkinBindings.wkhtmltopdf_set_object_setting(config, prefix + "." + "right", _rightText);
     }
     if (_lineSeparator != null)
     {
         PechkinBindings.wkhtmltopdf_set_object_setting(config, prefix + "." + "line", _lineSeparator);
     }
     if (_space != null)
     {
         PechkinBindings.wkhtmltopdf_set_object_setting(config, prefix + "." + "space", _space);
     }
     if (_htmlUrl != null)
     {
         PechkinBindings.wkhtmltopdf_set_object_setting(config, prefix + "." + "htmlUrl", _htmlUrl);
     }
 }
Esempio n. 2
0
        public static int SetObjectSetting(IntPtr setting, string name, string value)
        {
            if (Log.IsTraceEnabled)
            {
                Log.Trace("T:" + Thread.CurrentThread.Name + " Setting object setting (wkhtmltopdf_set_object_setting)");
            }

            return(PechkinBindings.wkhtmltopdf_set_object_setting(setting, name, value));
        }
Esempio n. 3
0
        internal void SetUpObjectConfig(IntPtr config)
        {
            ILog log = LogManager.GetCurrentClassLogger();

            if (log.IsTraceEnabled)
            {
                log.Trace("T:" + Thread.CurrentThread.Name + " Setting up object config (many wkhtmltopdf_set_object_setting)");
            }

            if (_tocUseDottedLines != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "toc.useDottedLines", _tocUseDottedLines);
            }
            if (_tocCaption != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "toc.captionText", _tocCaption);
            }
            if (_tocCreateLinks != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "toc.forwardLinks", _tocCreateLinks);
            }
            if (_tocBackLinks != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "toc.backLinks", _tocBackLinks);
            }
            if (_tocIndentation != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "toc.indentation", _tocIndentation);
            }
            if (_tocFontScale != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "toc.fontScale", _tocFontScale);
            }
            if (_createToc != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "isTableOfContent", _createToc);
            }
            if (_includeInOutline != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "includeInOutline", _includeInOutline);
            }
            if (_pagesCount != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "pagesCount", _pagesCount);
            }
            if (_tocXsl != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "tocXsl", _tocXsl);
            }
            if (_pageUri != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "page", _pageUri);
            }
            if (_useExternalLinks != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "useExternalLinks", _useExternalLinks);
            }
            if (_useLocalLinks != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "useLocalLinks", _useLocalLinks);
            }
            if (_produceForms != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "produceForms", _produceForms);
            }
            if (_loadUsername != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "load.username", _loadUsername);
            }
            if (_loadPassword != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "load.password", _loadPassword);
            }
            if (_loadJsDelay != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "load.jsdelay", _loadJsDelay);
            }
            if (_loadZoomFactor != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "load.zoomFactor", _loadZoomFactor);
            }
            if (_loadRepeatCustomHeaders != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "load.repertCustomHeaders", _loadRepeatCustomHeaders);
            }
            if (_loadBlockLocalFileAccess != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "load.blockLocalFileAccess", _loadBlockLocalFileAccess);
            }
            if (_loadStopSlowScript != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "load.stopSlowScript", _loadStopSlowScript);
            }
            if (_loadDebugJavascript != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "load.debugJavascript", _loadDebugJavascript);
            }
            if (_loadErrorHandling != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "load.loadErrorHandling", _loadErrorHandling);
            }
            if (_loadProxy != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "load.proxy", _loadProxy);
            }
            if (_webPrintBackground != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "web.background", _webPrintBackground);
            }
            if (_webLoadImages != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "web.loadImages", _webLoadImages);
            }
            if (_webRunJavascript != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "web.enableJavascript", _webRunJavascript);
            }
            if (_webIntelligentShrinking != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "web.enableIntelligentShrinking", _webIntelligentShrinking);
            }
            if (_webMinFontSize != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "web.minimumFontSize", _webMinFontSize);
            }
            if (_webPrintMediaType != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "web.printMediaType", _webPrintMediaType);
            }
            if (_webDefaultEncoding != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "web.defaultEncoding", _webDefaultEncoding);
            }
            if (_webUserStylesheetUri != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "web.userStyleSheet", _webUserStylesheetUri);
            }
            if (_webEnablePlugins != null)
            {
                PechkinBindings.wkhtmltopdf_set_object_setting(config, "web.enablePlugins", _webEnablePlugins);
            }

            _header.SetUpObjectConfig(config, "header");
            _footer.SetUpObjectConfig(config, "footer");
        }