Miloš,
Sorry for my belated feedback.
Ability to insert remote images looks like a very promising
contribution. On the usermodel level I think the best would be to add
a new method to XSSFDrawing:
public XSSFPicture createPicture(XSSFClientAnchor anchor, URI externalRef) {
}
It will be almost identical to createPicture(XSSFClientAnchor anchor,
int pictureIndex), the only difference is that it will insert external
reference instead of internal.
A use case would look like this:
XSSFPicture pic = drawingPatriarch.createPicture(
new XSSFClientAnchor(0, 0, 0, 0, 0, 0, 9, 23),
URI.create("http://milos.malovic.net/slika.jpg"));
Notice that XSSFPicture can retrieve its data :
XSSFPictureData data = pic.getPictureData();
byte[] pictureBytes = data.getData();
The question is what should XSSFPictureData return if the
relationship is external:
(a) throw IllegalStateException("not supported for remote images")
(b) open InputStream and read data from remote.
(c) provide a way to check the type of the relationship (
pictureData.isRemote() ) and an alternative way to get the data.
the ability to get remote data is importantfor the
XSSFPicture.resize() method with adjusts picture anchor to 100%.
> Also, I would like to help about the other bugs / features.
You are very much welcome.
Regards,
Yegor
>
> --
> View this message in context:
> http://apache-poi.1045710.n5.nabble.com/Load-remote-image-inside-excel-sheet-tp5709821p5709890.html
> Sent from the POI - User mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]