Good day everyone :)
Can i get a little help please?
I want to generate a doc file from a model and wanna show an image from an attribute which have an image url.
I have an object, which has a description attribute.
This attribute contains an image url, which is :
My problem is, when i ran my code, it makes a system path from the url like this:
https:\csoportmunka.mvmh.hu\mvmcsoport\szabdoktar\mvmi\Munka\Kapcsolodo-publikalashoz\20160605_Anett.jpg
And the error message is : The filename, directory name, or volume label syntax is incorrect
I am running the following code below:
//----------------------------Read Image from Attribute----------------------------------
//Path of the requested picture
var path = oObjList[i1].ObjDef().Attribute(9, nloc).GetValue(false); --> get the correct url link
//Java File to get the picture
var fileMyFile = new java.io.File(path); --> Convert to system path
//FileReader
var reader = new java.io.FileReader(fileMyFile);
var fileByteArray = [];
//Convert picture to ByteArray
fileByteArray = java.nio.file.Files.readAllBytes(fileMyFile.toPath());
//Create JavaScript Array
var javaScriptArray = new Array();
//Now push data from Java Array to JavaScript Array
for (var i = 0; i < fileByteArray.length; i++){
javaScriptArray.push(fileByteArray[i]);
}
//Create Image from data
var image = Context.createPicture(javaScriptArray, Constants.IMAGE_FORMAT_JPG);
ooutfile.value.OutGraphic(image,-1,100,100);
//----------------------------Read Image from Attribute----------------------------------
Thank you for helping me out :)