I'm looking at creating an appearance stream for annotation of type markup highlight by applying raw commands and writing them to output stream. However, I could not pinpoint which correct classes to use.
And so far, I could not find a post on how to do it.
This is what I have.
ByteArrayOutputStream os = new ByteArrayOutputStream();
os.write("/Form Do".getBytes("ISO_8859_1"));
os.write("other commands to draw highlighted rectangle coordinates");
PdfStream stream = pdfAppearance.getFormXObject(0);
stream.writeContent(os);
Or are there any other classes involved needed for writing raw commands.
And correct me if I am wrong but it looks like drawing the rectangle coordinates in the PdfAppearance will have no effect since there seems to be a form necessary where the rectangle fills are drawn instead.