// step 4: we add some content
PdfContentByte cb = writer.getDirectContent();
PdfTemplate tp = cb.createTemplate(400, 300);
PdfPatternPainter pat = cb.createPattern(15, 15, null);
pat.rectangle(5, 5, 5, 5);
pat.fill();
pat.sanityCheck();
PdfSpotColor spc_cmyk = new PdfSpotColor("PANTONE 280 CV", new CMYKColor(0.9f, .2f, .3f, .1f));
SpotColor spot = new SpotColor(spc_cmyk, 0.25f);
tp.setPatternFill(pat, spot, .9f);