// invoke shading from content stream
// the raw command is "/name sh"
// replace "name" with the name of the shading
// compress parameter is set to false so that you can see the stream in a text editor
PDPageContentStream contentStream = new PDPageContentStream(document, page, true, false);
contentStream.appendRawCommands("/shax sh\n");
contentStream.appendRawCommands("/" + radialShadingName.getName() + " sh\n");
contentStream.close();
document.save(file);
document.close();