コード例 #1
0
        public static void NPageContent(PdfGraphics graphics, int NPage, float width, float height, PresupuestoDInfonavit Presupuesto)
        {
            _Presupuesto = Presupuesto;
            DrawinUbication(width, height);

            switch (NPage)
            {
            case 0:

                #region 1 Datos desglose
                foreach (var i in Presupuesto.PresupuestoDModelLst)
                {
                    if (!String.IsNullOrEmpty(i.Unidad))
                    {
                        _drawText.Default(i.Unidad);
                        AddDraw(graphics, _drawText, _PointF.Unidad);
                    }
                    if (!String.IsNullOrEmpty(i.Cantidad))
                    {
                        _drawText.Default(i.Cantidad);
                        AddDraw(graphics, _drawText, _PointF.Cantidad);
                    }
                    if (!String.IsNullOrEmpty(i.PrecioUnitario))
                    {
                        _drawText.Default(i.PrecioUnitario);
                        AddDraw(graphics, _drawText, _PointF.PrecioUnitario);
                    }
                    if (!String.IsNullOrEmpty(i.Importe))
                    {
                        _drawText.Default(i.Importe);
                        AddDraw(graphics, _drawText, _PointF.Importe);
                    }
                    if (!String.IsNullOrEmpty(i.SubTotal))
                    {
                        _drawText.Default(i.SubTotal);
                        AddDraw(graphics, _drawText, _PointF.SubTotal);
                    }
                }
                if (!String.IsNullOrEmpty(Presupuesto.TotalTexto))
                {
                    _drawText.Default(Presupuesto.TotalTexto);
                    AddDraw(graphics, _drawText, _PointF.TotalTexto);
                }
                if (!String.IsNullOrEmpty(Presupuesto.TotalCTexto))
                {
                    _drawText.Default(Presupuesto.TotalCTexto);
                    AddDraw(graphics, _drawText, _PointF.TotalCTexto);
                }
                #endregion
                break;

            case 1:


                break;

            default:
                break;
            }
        }
コード例 #2
0
        //, DrawText waterMark, DrawText numberDowload, QR qr
        public void AddGraphicJoin(PdfDocumentProcessor processor, Object data, EPDFFile pdfFile)
        {
            IList <PdfPage> Pages = processor.Document.Pages;

            for (int i = 0; i < Pages.Count; i++)
            {
                PdfPage Page = Pages[i];
                using (PdfGraphics graphics = processor.CreateGraphics())
                {
                    SizeF actualPageSize = PrepareGraphics.PrepareGraphicsSizeF(Page, graphics, DrawIngDpi, DrawIngDpi);
                    switch (pdfFile)
                    {
                    case EPDFFile.SolicitudLinea4:
                        SolicitudCreditoL4 SolicitudL4 = (SolicitudCreditoL4)data;
                        SolicitudCreditoContent.NPageContent(graphics, i, actualPageSize.Width, actualPageSize.Height, SolicitudL4);
                        break;

                    case EPDFFile.Presupuesto:
                        PresupuestoInfonavit Presupuesto = (PresupuestoInfonavit)data;
                        PresupuestoInfonavitContent.NPageContent(graphics, i, actualPageSize.Width, actualPageSize.Height, Presupuesto);
                        break;

                    case EPDFFile.PresupuestoDesglose:
                        PresupuestoDInfonavit PresupuestoDesglose = (PresupuestoDInfonavit)data;
                        PresupuestoDInfonavitContent.NPageContent(graphics, i, actualPageSize.Width, actualPageSize.Height, PresupuestoDesglose);
                        break;
                    }

                    graphics.AddToPageForeground(Page, DrawIngDpi, DrawIngDpi);
                }
            }
        }