Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions java/src/main/java/com/genexus/reports/PDFReportPDFBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,9 @@ public void GxAttris(String fontName, int fontSize, boolean fontBold, boolean fo
}
}
baseFont = createPDType1FontFromName(fontName);
baseFontName = fontName;
if (baseFont == null){
baseFont = getOrLoadFont(fontName, document);
baseFontName = fontName;
}

}
Expand Down Expand Up @@ -652,11 +652,14 @@ public void GxDrawText(String sTxt, int left, int top, int right, int bottom, in
log.debug("WARNING: HTML rendering is not natively supported by PDFBOX 2.0.27. Handcrafted support is provided but it is not intended to cover all possible use cases");

try {
float htmlBottomAux = (float)convertScale(bottom);
float htmlTopAux = (float)convertScale(top);

float drawingPageHeight = this.pageSize.getUpperRightY() - topMargin - bottomMargin;
float llx = leftAux + leftMargin;
float lly = drawingPageHeight - bottomAux;
float lly = drawingPageHeight - htmlBottomAux;
float urx = rightAux + leftMargin;
float ury = drawingPageHeight - topAux;
float ury = drawingPageHeight - htmlTopAux;

PDRectangle htmlRectangle = new PDRectangle(llx, lly, urx - llx, ury - lly);
SpaceHandler spaceHandler = new SpaceHandler(htmlRectangle.getUpperRightY(), htmlRectangle.getHeight());
Expand All @@ -668,13 +671,13 @@ public void GxDrawText(String sTxt, int left, int top, int right, int bottom, in
for (Element element : allElements) {
if (pageHeightExceeded(bottomMargin, spaceHandler.getCurrentYPosition())) {
llx = leftAux + leftMargin;
lly = drawingPageHeight - bottomAux;
lly = drawingPageHeight - htmlBottomAux;
urx = rightAux + leftMargin;
ury = drawingPageHeight - topAux;
ury = drawingPageHeight - htmlTopAux;
htmlRectangle = new PDRectangle(llx, lly, urx - llx, ury - lly);
spaceHandler = new SpaceHandler(htmlRectangle.getUpperRightY(), htmlRectangle.getHeight());

bottomAux -= drawingPageHeight;
htmlBottomAux -= drawingPageHeight;
GxEndPage();
GxStartPage();

Expand Down
Loading