2
pdf를 생성 할 때 y 좌표를 추적하고 싶습니다. 이것은 현재 어떻게 수행하고 있는지입니다.pdfBox의 apache에서 newLine()이 차지하는 높이는 어느 정도입니까?
PDRectangle mediabox = page.findMediaBox();
float margin = 15;
float y = mediabox.getUpperRightY() - margin;
float fontSize = 10f;
PDType1Font font = PDType1Font.HELVETICA;
contentStream.showText("Hello");
y = y - fontSize; //decrease y-coordinate
contentStream.newLine(); //go to new line
contentStream.showText("World!");
y = y - fontSize; //decrease y-coordinate
정확하게 y 좌표를 추적 할 수 있도록 새 행의 높이를 알고 싶습니다.
이렇게해야합니다.
contentStream.showText("Hello");
y = y - fontSize; //decrease y-coordinate
contentStream.newLine(); //go to new line
y = y - newLineSize; <---- require the height of new line.
contentStream.showText("World!");
y = y - fontSize; //decrease y-coordinate
감사합니다.