virtual public void RetrieveStreamFromFile() { output = new FileStream(actual, FileMode.Create); FileStream css = File.OpenRead(RESOURCES + @"\css\test.css"); retriever.ProcessFromStream(css, new CustomReadingProcessor()); css.Close(); output.Close(); Assert.IsTrue(FilesEqual(expected, actual)); }
/* (non-Javadoc) * @see com.itextpdf.tool.xml.pipeline.css.CSSResolver#addCss(java.lang.String) */ public void AddCss(String content, bool isPersistent) { CssFileProcessor proc = new CssFileProcessor(); IFileRetrieve retrieve = new FileRetrieveImpl(); try { retrieve.ProcessFromStream(new MemoryStream(Encoding.GetEncoding(1252).GetBytes(content)), proc); ICssFile css = proc.GetCss(); css.IsPersistent(isPersistent); this.cssFiles.Add(css); } catch (IOException e) { throw new CssResolverException(e); } }