iTextSharp.tool.xml.css.StyleAttrCSSResolver.AddCssFile C# (CSharp) Method

AddCssFile() public method

public AddCssFile ( String href, bool isPersistent ) : void
href String
isPersistent bool
return void
        public void AddCssFile(String href, bool isPersistent)
        {
            CssFileProcessor cssFileProcessor = new CssFileProcessor();
            try {
                retrieve.ProcessFromHref(href, cssFileProcessor);
            } catch (IOException e) {
                throw new CssResolverException(e);
            }
            ICssFile css = cssFileProcessor.GetCss();
            css.IsPersistent(isPersistent);
            this.cssFiles.Add(css);
        }

Usage Example

 virtual public void SetUp() {
     LoggerFactory.GetInstance().SetLogger(new SysoLogger(3));
     files = new CssFilesImpl();
     StyleAttrCSSResolver resolver = new StyleAttrCSSResolver(files);
     string u = RESOURCES + "/css/style.css";
     resolver.AddCssFile(u.Replace("%20", " "), false); // fix url conversion of space (%20) for File
     Dictionary<String, String> attr = new Dictionary<String, String>();
     t = new Tag("body", attr);
 }
All Usage Examples Of iTextSharp.tool.xml.css.StyleAttrCSSResolver::AddCssFile