Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Wed Apr 15, 2015 4:54 pm

I need my page number label to have transparency 0.5 but it is not working. I have following code:

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.

jbojcic
 
Posts: 23
Joined: Mon Apr 13, 2015 3:03 pm

Thu Apr 16, 2015 6:19 am

Hello,

Thanks for your inquiry.
I have reproduced your issue, sorry. I have posted the issue to our dev team.We will inform you when it is fixed.

Sincerely,
Sweety

E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Thu Apr 16, 2015 1:26 pm

Thanks. I made a workaround for now by setting font color to color of transparent text so it is ok.

jbojcic
 
Posts: 23
Joined: Mon Apr 13, 2015 3:03 pm

Fri Apr 17, 2015 2:00 am

Hello,

Thanks for your sharing.
Please feel free to contact us, if you have any questions or needs. We are here for help.

Sincerely,
Sweety

E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Return to Spire.PDF