예제 #1
0
        private static void ExportPdfSelfInvoice(SelfInvoices selfInvoices, ContoData contoData, Document doc, PdfWriter writer,
                                                 PdfTemplate background)
        {
            var material = contoData.MaterialGet(selfInvoices.MaterialId);

            doc.NewPage();
            var pcb = writer.DirectContentUnder;

            pcb.AddTemplate(background, 0, 0);

            pcb = writer.DirectContent;
            pcb.BeginText();
            pcb.SetFontAndSize(Font, 10);

            // invoice date
            pcb.SetTextMatrix(469, 650);
            pcb.ShowText(selfInvoices.InvoiceDate.ToString("dd/MM/yyyy"));
            // invoice number
            pcb.SetTextMatrix(469, 613);
            pcb.ShowText(string.Format("{0}/{1}", selfInvoices.InvoiceNumber,
                                       selfInvoices.InvoiceYear.ToString(CultureInfo.InvariantCulture).Substring(2)));
            // invoice owner
            SelfInvoiceOwner(pcb, contoData.GetSettings());
            // material description
            SelfInvoiceDescription(pcb, material.Description);


            SelfInvoiceQuantity(pcb, selfInvoices.Quantity);
            SelfInvoiceMaterialPrice(pcb, material.Price.HasValue ? material.Price.Value : 0);
            SelfInvoiceAmount(pcb, selfInvoices.InvoiceCost);

            TaxableAmount(pcb, selfInvoices.InvoiceCost);
            TotalAmount(pcb, selfInvoices.InvoiceCost);

            pcb.EndText();
        }