I'm having difficulty converting the below code from Java to C#.
this.document.add(new VerticalPositionMark() {
@Override
public void draw(final PdfContentByte canvas, final float llx, final float lly, final float urx, final float ury, final float y)
{
final PdfTemplate createTemplate = canvas.createTemplate(50, 50);
Main.this.tocPlaceholder.put(title, createTemplate);
canvas.addTemplate(createTemplate, urx - 50, y);
}
});
I'm not really sure if it's possible to override on instantiation in C#. If there isn't, is there a way to replicate the code to achieve what's needed?