p2.addImage(img, img.getScaledWidth(), 0f, 0f, img.getScaledHeight(), 0f, 0f);
p2.setPatternMatrix(1f, 0f, 0f, 1f, 60f, 60f);
p2.sanityCheck();
// See if we can apply the pattern color to chunk, phrase or paragraph
PatternColor pat = new PatternColor(p);
PatternColor pat1 = new PatternColor(p1);
PatternColor pat2 = new PatternColor(p2);
String text = "Text with pattern";
document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, new GrayColor(0.3f))));
document.add(new Paragraph(text, FontFactory.getFont(FontFactory.HELVETICA, 60, LwgFont.BOLD, pat)));
// draw a rectangle filled with star pattern