public static void Create(IElementListener document, int invoiceNumber, InvoiceEntity invoiceEntity, CompanyInformationEntity companyInformationEntity, DateTime now) { var table = new PdfPTable(2) { WidthPercentage = 100 }; table.AddCell(GetCompanyNameAndSlogan(invoiceEntity, companyInformationEntity)); table.AddCell(GetInvoiceTitle()); table.AddCell(GetCompanyAddress(invoiceEntity, companyInformationEntity)); table.AddCell(GetInvoiceDetails(invoiceNumber,now)); document.Add(table); }
// implementation of the Element-methods /// <summary> /// Processes the element by adding it (or the different parts) to an /// IElementListener. /// </summary> /// <param name="listener">the IElementListener</param> /// <returns>true if the element was processed successfully</returns> public bool Process(IElementListener listener) { try { foreach (IElement ele in this) { listener.Add(ele); } return true; } catch (DocumentException de) { de.GetType(); return false; } }
// implementation of the Element-methods /// <summary> /// Processes the element by adding it (or the different parts) to an /// <see cref="iTextSharp.text.IElementListener"/>. /// </summary> /// <param name="listener">an IElementListener</param> /// <returns>true if the element was processed successfully</returns> public virtual bool Process(IElementListener listener) { try { foreach (IElement ele in this) { listener.Add(ele); } return(true); } catch (DocumentException) { return(false); } }
/** * Processes the element by adding it (or the different parts) to an * <CODE>ElementListener</CODE>. * * @param listener an <CODE>ElementListener</CODE> * @return <CODE>true</CODE> if the element was processed successfully */ public override bool Process(IElementListener listener) { try { foreach (IElement element in ((Section)this.element)) { listener.Add(element); } return(true); } catch (DocumentException) { return(false); } }
// implementation of the Element-methods /// <summary> /// Processes the element by adding it (or the different parts) to an /// IElementListener. /// </summary> /// <param name="listener">an IElementListener</param> /// <returns>true if the element was processed successfully</returns> public bool process(IElementListener listener) { try { foreach (IElement ele in list) { listener.Add(ele); } return(true); } catch (DocumentException de) { de.GetType(); return(false); } }
private void AddAllGeneralSum(TypeReport predicate, IElementListener doc) { if (predicate == TypeReport.All) { var sum = _materialAidEmployeesGeneralSum + _awardEmployeesGeneralSum + _culturalEmployeesGeneralSum + _travelEventEmployeesGeneralSum + _wellnessEventEmployeesGeneralSum + _tourEventEmployeesGeneralSum + _giftEmployeesGeneralSum; doc.Add(new Paragraph($"Cумма - {sum} {Сurrency}", Font) { Alignment = Element.ALIGN_RIGHT }); AddEmptyParagraph(doc, 2); } }
private static void GenerateContent(IElementListener document, PdfContentByte directContent, Invoice invoice) { AddIssuingCompany(directContent, invoice); AddInvoiceHeadingPart(directContent, invoice); document.Add(GetHeaderPart(invoice)); document.Add(new Paragraph("\n")); document.Add(new Paragraph("\n")); document.Add(new Paragraph("\n")); document.Add(new Paragraph("\n")); document.Add(GetCompaniesPart(invoice)); document.Add(new Paragraph("\n")); document.Add(GetInvoiceLinesPart(invoice)); document.Add(new Paragraph("\n")); document.Add(GetFooterPart(invoice)); }
private void CreateDocumentBody(IElementListener document, AnalysisFile analysisFile) { var table = new PdfPTable(2) { SpacingBefore = 25.0f }; table.SetWidths(new[] { 1, 2 }); AddRow(table, "File name", analysisFile.FileName); AddRow(table, "Performed by", analysisFile.UserId.ToString()); AddRow(table, "Analysis status", Enum.GetName(analysisFile.Status)); AddRow(table, "Status change date", analysisFile.Date.ToString(CultureInfo.InvariantCulture)); if (analysisFile.Status == OperationStatus.Complete) { AddHighlightedResultRow(table, analysisFile.Result); } document.Add(table); }
private static void AddPersonalInfo(IElementListener document, EmployeeDetailsModel user) { var table = new PdfPTable(1) { WidthPercentage = 100 }; table.DefaultCell.Border = Rectangle.NO_BORDER; table.SpacingBefore = 20; var headerCell = new PdfPCell { Border = Rectangle.NO_BORDER }; var headerPhrase = new Phrase("Personal Info"); headerCell.Phrase = headerPhrase; headerPhrase.Font.Color = BaseColor.BLUE; table.AddCell(headerCell); table.AddCell(user.Description.Title); table.AddCell(user.Description.Text); document.Add(table); }
private static void AddExperience(IElementListener document, EmployeeDetailsModel user) { var table = new PdfPTable(2) { WidthPercentage = 100 }; table.SetWidths(new int[] { 1, 4 }); table.DefaultCell.Border = Rectangle.NO_BORDER; table.SpacingBefore = 20; var headerCell = new PdfPCell { Border = Rectangle.NO_BORDER, Colspan = 2 }; var headerPhrase = new Phrase("Experience"); headerCell.Phrase = headerPhrase; headerPhrase.Font.Color = BaseColor.BLUE; table.AddCell(headerCell); foreach (var experience in user.Experiences) { var endDate = experience.EndDate != null?experience.EndDate?.ToString("MMMM yyyy", CultureInfo.CreateSpecificCulture("en-us")) : "Current time"; var years = new Phrase(experience.BeginDate.ToString("MMMM yyyy", CultureInfo.CreateSpecificCulture("en-us")) + " -\n" + endDate); var yearsCell = new PdfPCell(years) { Border = Rectangle.NO_BORDER, Rowspan = 2 }; table.AddCell(yearsCell); table.AddCell(experience.Position); table.AddCell(experience.Description); } document.Add(table); }
// these Element methods are irrelevant for a table stub. virtual public bool Process(IElementListener listener) { return(false); }
/// <summary> /// Create the slice header /// </summary> /// <param name="doc"> /// The <see cref="Document"/> /// </param> /// <param name="state"> /// The current <see cref="HtmlRenderer.RendererState"/> /// </param> private void CreateSliceHeader(IElementListener doc, RendererState state) { Table headerTable = this.CreateSliceHeaderTable(state); PdfPTable table = CreatePdf(headerTable); if (table != null) { doc.Add(table); table.DeleteBodyRows(); } }
/* (non-Javadoc) * @see com.itextpdf.text.Element#process(com.itextpdf.text.ElementListener) */ public bool Process(IElementListener listener) { throw new iTextSharp.tool.xml.exceptions.NotImplementedException(); }
public bool Process(IElementListener listener) { return(true); }
public bool Process(IElementListener listener) { return true; }
/* * (non-Javadoc) * * @see com.itextpdf.text.Element#process(com.itextpdf.text.ElementListener) */ public bool Process(IElementListener listener) { throw new NotSupportedException(); }
// these Element methods are irrelevant for a table stub. virtual public bool Process(IElementListener listener) { return false; }
// implementation of the Element-methods /// <summary> /// Processes the element by adding it (or the different parts) to a /// IElementListener. /// </summary> /// <param name="listener">an IElementListener</param> /// <returns>true if the element was processed successfully</returns> public bool Process(IElementListener listener) { try { return listener.Add(this); } catch (DocumentException de) { de.GetType(); return false; } }
public bool Process(IElementListener listener) { // TODO Auto-generated method stub return(false); }
/** * Processes the element by adding it (or the different parts) to an * <CODE>ElementListener</CODE>. * * @param listener an <CODE>ElementListener</CODE> * @return <CODE>true</CODE> if the element was processed successfully */ public override bool Process(IElementListener listener) { try { foreach (IElement element in ((Section)this.element)) { listener.Add(element); } return true; } catch (DocumentException) { return false; } }
/* (non-Javadoc) * @see com.itextpdf.text.Element#process(com.itextpdf.text.ElementListener) */ virtual public bool Process(IElementListener listener) { throw new iTextSharp.tool.xml.exceptions.NotImplementedException(); }
public bool Process(IElementListener listener) => true;
// implementation of the Element-methods /// <summary> /// Processes the element by adding it (or the different parts) to an /// <see cref="T:iTextSharp.text.IElementListener"/> /// </summary> /// <param name="listener">an IElementListener</param> /// <returns>true if the element was processed successfully</returns> public override bool Process(IElementListener listener) { try { bool localDestination = (reference != null && reference.StartsWith("#")); bool notGotoOK = true; foreach (Chunk chunk in this.Chunks) { if (name != null && notGotoOK && !chunk.IsEmpty()) { chunk.SetLocalDestination(name); notGotoOK = false; } if (localDestination) { chunk.SetLocalGoto(reference.Substring(1)); } else if (reference != null) chunk.SetAnchor(reference); listener.Add(chunk); } return true; } catch (DocumentException) { return false; } }
public override bool Process(IElementListener listener) { return(false); }
public override bool Process(IElementListener listener) { return false; }
// implementation of the Element-methods /// <summary> /// Processes the element by adding it (or the different parts) to an /// IElementListener. /// </summary> /// <param name="listener">an IElementListener</param> /// <returns>true if the element was processed successfully</returns> public bool Process(IElementListener listener) { try { foreach (IElement ele in list) { listener.Add(ele); } return true; } catch (DocumentException) { return false; } }
private void AddNameReport(ReportModel model, IElementListener doc) { switch (model.Type) { case TypeReport.All: doc.Add(new Paragraph("Звіт по всім дотаційним заходам члена профспілки", FontBold) { Alignment = Element.ALIGN_CENTER }); break; case TypeReport.MaterialAid: doc.Add(new Paragraph("Звіт по матеріальним допомогам члена профспілки", FontBold) { Alignment = Element.ALIGN_CENTER }); break; case TypeReport.Award: doc.Add(new Paragraph("Звіт по матеріальним заохоченням члена профспілки", FontBold) { Alignment = Element.ALIGN_CENTER }); break; case TypeReport.Travel: doc.Add(new Paragraph("Звіт по поїздкам члена профспілки", FontBold) { Alignment = Element.ALIGN_CENTER }); break; case TypeReport.Wellness: doc.Add(new Paragraph("Звіт по оздоровленням члена профспілки", FontBold) { Alignment = Element.ALIGN_CENTER }); break; case TypeReport.Tour: doc.Add(new Paragraph("Звіт по путівкам члена профспілки", FontBold) { Alignment = Element.ALIGN_CENTER }); break; case TypeReport.Cultural: doc.Add(new Paragraph("Звіт по культурно-просвітницьким закладам члена профспілки", FontBold) { Alignment = Element.ALIGN_CENTER }); break; case TypeReport.Gift: doc.Add(new Paragraph("Звіт по подарункам члена профспілки", FontBold) { Alignment = Element.ALIGN_CENTER }); break; default: throw new ArgumentOutOfRangeException(); } }
/** * Processes the element by adding it (or the different parts) to an * <CODE>ElementListener</CODE>. * * @param listener an <CODE>ElementListener</CODE> * @return <CODE>true</CODE> if the element was processed successfully */ virtual public bool Process(IElementListener listener) { try { return listener.Add(this); } catch (DocumentException) { return false; } }
public bool Process(IElementListener listener) { // TODO Auto-generated method stub return false; }