document.open();
// step 4:
BaseFont bf = BaseFont.createFont(BaseFont.HELVETICA, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
PdfContentByte cb = writer.getDirectContent();
PdfTemplate template = cb.createTemplate(500, 200);
template.setLineWidth(2f);
template.rectangle(2.5f, 2.5f, 495f, 195f);
template.stroke();
template.setLineWidth(12f);
template.arc(40f - (float) Math.sqrt(12800), 120f + (float) Math.sqrt(12800), 200f - (float) Math.sqrt(12800), -40f + (float) Math.sqrt(12800), 281.25f, 33.75f);
template.arc(40f, 120f, 200f, -40f, 90f, 45f);
template.stroke();
template.setLineCap(1);
template.setLineWidth(12f);
template.arc(80f, 40f, 160f, 120f, 90f, 180f);
template.arc(115f, 75f, 125f, 85f, 0f, 360f);
template.stroke();
template.beginText();
template.setFontAndSize(bf, 180);
template.setRGBColorFill(0xFF, 0x00, 0x00);
template.showTextAligned(PdfContentByte.ALIGN_LEFT, "T", 125f, 35f, 0f);
template.resetRGBColorFill();
template.showTextAligned(PdfContentByte.ALIGN_LEFT, "ext", 220f, 35f, 0f);
template.endText();
template.sanityCheck();
cb.addTemplate(template, 0, 1, -1, 0, 500, 200);
cb.addTemplate(template, .5f, 0, 0, .5f, 100, 400);
cb.addTemplate(template, 0.25f, 0, 0, 0.25f, 100, 100);
cb.sanityCheck();