public static void main(String[] args) {
System.out.println("Shading");
LwgDocument document = new LwgDocument(LwgPageSize.A4, 50, 50, 50, 50);
try {
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream("shading.pdf"));
document.open();
PdfFunction function1 = PdfFunction.type2(writer, new float[]{0, 1}, null,
new float[]{.929f, .357f, 1, .298f}, new float[]{.631f, .278f, 1, .027f}, 1.048f);
PdfFunction function2 = PdfFunction.type2(writer, new float[]{0, 1}, null,
new float[]{.929f, .357f, 1, .298f}, new float[]{.941f, .4f, 1, .102f}, 1.374f);