Open mdrbrand opened 8 years ago
the following works for me
around line 130 in PointRenderer.java
original line: image = PDFUtils.createImage(context, width * f, height * f, new URI(style.getString("externalGraphic")), 0.0f);
Change import com.itextpdf.text.pdf.codec.Base64; .... String src = style.getString("externalGraphic"); Image image=null; if (src.startsWith("data:image/")) { try { final String base64Data = src.substring(src.indexOf(",") + 1); image = Image.getInstance(Base64.decode(base64Data)); //image.scaleAbsolute(width * f, height * f); } catch (Exception e) { context.addError(e); } } else { image = PDFUtils.createImage(context, width * f, height * f, new URI(style.getString("externalGraphic")), 0.0f); }
Exception-handling could be better ...
Thanks for sharing!
Any news on this one? I need this too.
EDIT: I need this feature in v3.
In openlayers it is allowed to set a dataurl as ExternalGraphic for a pointsymbol. This is not supported yet.