- Code: Select all
...
bottomSpace.Graphics.SetTransparency(0.5f);
bottomSpace.Graphics.DrawImage(footerImage, footerLocation);
PdfFont footerFont = new PdfFont(PdfFontFamily.Helvetica, 6f);
PdfSolidBrush footerBrush = new PdfSolidBrush(new PdfRGBColor(56, 62, 75));
PdfStringFormat centerAlignment = new PdfStringFormat(PdfTextAlignment.Center, PdfVerticalAlignment.Top);
bottomSpace.Graphics.DrawString("Powered By", footerFont, footerBrush, bottomSpace.Graphics.ClientSize.Width / 2, y, centerAlignment);
PdfPageNumberField pageNumber = new PdfPageNumberField();
PdfPageCountField pageCount = new PdfPageCountField();
PdfCompositeField pageNumberLabel = new PdfCompositeField();
pageNumberLabel.AutomaticFields = new PdfAutomaticField[] { pageNumber, pageCount };
pageNumberLabel.Brush = footerBrush;
pageNumberLabel.Font = footerFont;
pageNumberLabel.StringFormat = format;
pageNumberLabel.Text = "{0} of {1}";
pageNumberLabel.Draw(bottomSpace.Graphics, bottomSpace.Graphics.ClientSize.Width - 79, bottomSpace.Graphics.ClientSize.Height - footerFont.Height);
Everything is working fine (image and "Powered By" text have 0.5 transparency) except page number label transparency which looks like 1 instead of 0.5.