|
27 | 27 | import org.apache.pdfbox.pdmodel.*;
|
28 | 28 | import org.apache.pdfbox.pdmodel.common.PDRectangle;
|
29 | 29 | import org.apache.pdfbox.pdmodel.font.*;
|
30 |
| -import org.apache.pdfbox.pdmodel.graphics.color.PDColor; |
31 |
| -import org.apache.pdfbox.pdmodel.graphics.color.PDDeviceRGB; |
32 | 30 | import org.apache.pdfbox.pdmodel.graphics.form.PDFormXObject;
|
33 | 31 | import org.apache.pdfbox.pdmodel.graphics.image.LosslessFactory;
|
34 | 32 | import org.apache.pdfbox.pdmodel.graphics.image.PDImageXObject;
|
|
43 | 41 | import org.jsoup.nodes.Node;
|
44 | 42 | import org.jsoup.select.Elements;
|
45 | 43 |
|
| 44 | +import javax.imageio.IIOException; |
| 45 | + |
46 | 46 | public class PDFReportPDFBox extends GXReportPDFCommons{
|
47 | 47 | private PDRectangle pageSize;
|
48 | 48 | private PDFont baseFont;
|
@@ -626,8 +626,6 @@ else if (valign == PDFReportPDFBox.VerticalAlign.BOTTOM.value())
|
626 | 626 | htmlRectangle.setLowerLeftY(lly);
|
627 | 627 | htmlRectangle.setUpperRightX(urx);
|
628 | 628 | htmlRectangle.setUpperRightY(ury);
|
629 |
| - cb.addRect(llx, lly, urx - llx, ury - lly); |
630 |
| - cb.stroke(); |
631 | 629 | SpaceHandler spaceHandler = new SpaceHandler(htmlRectangle.getUpperRightY(), htmlRectangle.getHeight());
|
632 | 630 |
|
633 | 631 | loadSupportedHTMLTags();
|
@@ -920,8 +918,6 @@ private void processHTMLElement(PDPageContentStream cb, PDRectangle htmlRectangl
|
920 | 918 | for (Element listItem : blockElement.select("li")){
|
921 | 919 | String text = (tagName.equals("ul")) ? "• " + listItem.text() : i + ". " + listItem.text();
|
922 | 920 | i++;
|
923 |
| - if (listItem.normalName().equals("ol") || listItem.normalName().equals("ul")) //arreglar esta porqueria |
924 |
| - processHTMLElement(cb, htmlRectangle, spaceHandler, listItem); |
925 | 921 | float lines = renderHTMLContent(cb, text, fontSize, llx, lly, urx, spaceHandler.getCurrentYPosition());
|
926 | 922 | float totalTextHeight = lineHeight * lines * DEFAULT_PDFBOX_LEADING;
|
927 | 923 | spaceHandler.setCurrentYPosition(spaceHandler.getCurrentYPosition() - totalTextHeight);
|
@@ -952,7 +948,7 @@ private void processHTMLElement(PDPageContentStream cb, PDRectangle htmlRectangl
|
952 | 948 | }
|
953 | 949 | else
|
954 | 950 | image = PDImageXObject.createFromFile(bitmap,document);
|
955 |
| - } catch(java.lang.IllegalArgumentException | FileNotFoundException e) { |
| 951 | + } catch(java.lang.IllegalArgumentException | FileNotFoundException |IIOException e) { |
956 | 952 | URL url= new java.net.URL(bitmap);
|
957 | 953 | image = PDImageXObject.createFromByteArray(document, IOUtils.toByteArray(url.openStream()),bitmap);
|
958 | 954 | }
|
|
0 commit comments