Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.90 KB | None | 0 0
  1. diff --git a/src/main/java/technology/tabula/TextElement.java b/src/main/java/technology/tabula/TextElement.java
  2. index f54c4e2..bfcaa87 100644
  3. --- a/src/main/java/technology/tabula/TextElement.java
  4. +++ b/src/main/java/technology/tabula/TextElement.java
  5. @@ -22,7 +22,13 @@ public class TextElement extends Rectangle implements HasText {
  6. public TextElement(float y, float x, float width, float height,
  7. PDFont font, float fontSize, String c, float widthOfSpace, float dir) {
  8. super();
  9. - this.setRect(x, y, width, height);
  10. +
  11. + if (dir == 90 || dir == 270) {
  12. + // Swap x and y coordinates and width and height in case of vertical direction
  13. + this.setRect(y, x, height, width);
  14. + } else {
  15. + this.setRect(x, y, width, height);
  16. + }
  17. this.text = c;
  18. this.widthOfSpace = widthOfSpace;
  19. this.fontSize = fontSize;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement