I am trying to draw a vertical gradient at the bottom of an iTextSharp PDF:
PdfShading shading
= PdfShading.SimpleAxial(pdfWriter, 0, document.PageSize.Height,
document.PageSize.Width, 0, BaseColor.WHITE, BaseColor.GREEN);
PdfShadingPattern pattern = new PdfShadingPattern(shading);
pdfContentByte.SetShadingFill(pattern);
pdfContentByte.Rectangle(0, 0, document.PageSize.Width, 70);
pdfContentByte.Fill();
This creates a gradient in the exact position. I want it to be created, but the gradient is horizontal on the left (white) and on the right (green).
I want the gradient to be vertical from top to bottom (white) to bottom (green).
Changing the coordinates, as some of them did ( does iTextsharp support multicolor diagonal gradients? ), Did not solve the problem. I also tried to rotate the document, but that didn't work.
source
share