public void TestPdfCleaner() { PdfCompiler m = new PdfCompiler("c:\\ds21vuoto.pdf", "c:\\ds21prova3.pdf"); m.Setup(); m.SetCampo("datanascita", "2/10/1984"); m.SetCampo("nome", "paolo"); m.Compile(); m.Dispose(); PdfCleaner n = new PdfCleaner("c:\\ds21prova3.pdf"); n.Setup(); n.CleanAllFields(); n.Dispose(); PdfDescriber c = new PdfDescriber("c:\\ds21prova3.pdf"); c.Setup(); System.Collections.Hashtable arr = c.GetFieldsInfoToHashtable(); foreach (DictionaryEntry elem in arr) { Assert.AreEqual(c.GetField(elem.Key.ToString()), ""); } c.Dispose(); File.Delete("c:\\ds21prova3.pdf"); }
public void PdfDescriberTest() { //PdfCompiler c = new PdfCompiler ("c:\\ds21vuoto.pdf","c:\\provadescriber.pdf"); //c.Setup(); //c.SetCampo("nome", "paolo"); //c.Compile(); //c.Dispose(); PdfDescriber p = new PdfDescriber("C:\\bolzano.pdf"); //PdfDescriber p = new PdfDescriber("C:\\Mod Cure Termali.pdf"); p.Setup(); p.GetFieldsInfoToFile("c:\\prova.txt"); p.Dispose(); File.Delete("c:\\provadescriber.pdf"); string[] s = File.ReadAllLines("c:\\prova.txt"); //Assert.IsTrue(s.Contains("nome paolo")); //File.Delete("c:\\prova.txt"); }