Exemplo n.º 1
0
        private System.Drawing.Image getImage(string fileName)
        {
            var bytes = File.ReadAllBytes(projekt.getFullName(fileName));
            var ms    = new MemoryStream(bytes);
            var img   = System.Drawing.Image.FromStream(ms);

            return(img);
        }
Exemplo n.º 2
0
        private void addCards(PdfContentByte cb, int page, bool awers = true)
        {
            int start = page * perPage;

            for (int i = start; i < start + Math.Min(perPage, cardsLeft); i++)
            {
                var image = loadImage(projekt.getFullName(awers ? projekt.Karty[i].Awers : projekt.Karty[i].Rewers));
                image.SetAbsolutePosition(calculateXPosition(i % perPage, awers), calculateYPosition(i % perPage));
                image.ScaleAbsolute(imgW, imgH);
                cb.AddImage(image);
            }
            pdf.NewPage();
        }