private static PdfTemplate createTemplate(PdfContentByte content, Rectangle rect, int factor) { PdfTemplate template = content.CreateTemplate(rect.Width, rect.Height); template.ConcatCtm(factor, 0, 0, factor, 0, 0); var hero = TestUtils.GetTxtPath("hero.txt"); if (!File.Exists(hero)) { throw new FileNotFoundException($"{hero} NOT FOUND!"); } var fi = new FileInfo(hero); using (var sr = fi.OpenText()) { while (sr.Peek() >= 0) { template.SetLiteral((char)sr.Read()); } } return(template); }