1

I'm using itextpdf 5 in my project

I want to draw a change bar for any element.

My method drawBar take in input Y1 and Y2 positions like this :

drawBar(float y1, float y2, PdfWriter writer){
// draw bar
}

But I dont know how to get Y position for current pointer. Is it feasible ?

Valeriane
  • 936
  • 3
  • 16
  • 37

1 Answers1

5

You are looking for the getVerticalPosition() method on the PdfWriter. To get the "current" Y pass false to this and to get the "next" Y as if a line break were added pass true.

Chris Haas
  • 53,986
  • 12
  • 141
  • 274