public PdfTemplate CreateTemplateWithBarcode(PdfContentByte cb, Color barColor, Color textColor) { PdfTemplate tp = cb.CreateTemplate(0, 0); Rectangle rect = PlaceBarcode(tp, barColor, textColor); tp.BoundingBox = rect; return tp; }