My requirement is straight, I want to create a rectangle positioned vertically and add text to it starting from bottom to going upward direction. (basically 90 degree box) in all pages of PDF
I tried achieving it using below code snap, but I want it to be enclosed within a specific dimension of box, which I cant control using this ColumnText
approach
for example:
ColumnText.showTextAligned(canvas, PdfContentByte.ALIGN_LEFT, note,
.03F * pageWidth, .68F * pageHeight, 90);
For a task like yours the static convenience methods of
ColumnText
don't suffice, you need to actually create and parameterize a fullColumnText
instance.For example like this:
(AddTextBox test
testRotatedBoxForAbbas
)(While this test has been created for iText 5, it should work identically with iText 2.1.7 and OpenPdf after adapting the import packages.)
You didn't mention dimensions in this question but in your previous, removed one you mentioned dimensions given in mm, so I also used millimeters here.
The result on an empty source page: