Esempio n. 1
0
        public override void AddImage(IImage image)
        {
            if (image != null)
            {
                itImage img = PDFRenderer.ConvertImage(image);

                float fitWidth = fColumnWidth * 0.5f;
                img.ScaleToFit(fitWidth, fitWidth);

                // FIXME: the moving, if the page height is insufficient for the image height

                //img.Alignment = Image.TEXTWRAP;
                img.IndentationLeft = 5f;
                img.SpacingBefore   = 5f;
                img.SpacingAfter    = 5f;

                //Paragraph imgpar = new Paragraph(new Chunk(img, 0, 0, true));
                //imgpar.KeepTogether = true;

                if (fMulticolumns)
                {
                    fColumns.AddElement(img);
                }
                else
                {
                    fDocument.Add(img);
                }
            }
        }
Esempio n. 2
0
        public override ChartRenderer GetPageRenderer()
        {
            var   itPS       = fDocument.PageSize;
            float pageHeight = itPS.Height;
            float pageWidth  = itPS.Width;

            var renderer = new PDFRenderer(pageWidth, pageHeight);

            renderer.SetTarget(fPdfWriter.DirectContent);
            return(renderer);
        }