private void CommonConstructor( iTextSharp.text.Rectangle pageSize, float marginLeft, float marginRight, float marginTop, float marginBottom, System.IO.Stream stream, string fontpath, BackgroundImageDefinition bImageDefinition ){ if(this.fontpath != null)this.fontpath = fontpath; this.margin_left = marginLeft; this.margin_right = marginRight; this.margin_top = marginTop; this.margin_bottom = marginBottom; this.pageSize = pageSize; this._backgroundImage = bImageDefinition; _pdfDoc = new iTextSharp.text.Document(pageSize, margin_left, margin_right, margin_top, margin_bottom); _iPDFWriter = iTextSharp.text.pdf.PdfWriter.GetInstance(PdfDoc, stream); PdfDoc.Open(); iPDFContent = PDFWriter.DirectContent; _init(); initRow(); }
/// <summary> /// Store background image. /// </summary> /// <param name="backgroundImage"></param> public void SetBackgroundImage(BackgroundImageDefinition backgroundImage) { this._backgroundImage = backgroundImage; DrawBackgroundImage(); }