Hi Breg ,
Please find the sample case below ,
Use the core.storefilestoredocument
Initialize output file like below,
customFileDocument OutputFile = new customFileDocument(Context);
SimpleDateFormat formatter = new SimpleDateFormat("dd_MM_yyyy_HH_mm_ss");
Date date = new Date();
OutputFile.setName("Sample_"+formatter.format(date)+".pdf");
Core.getLogger("ExportToPDF").info("File Name : " + OutputFile.getName());
for storing the content use core.storefilestoredocument and return output file as output
try (ByteArrayInputStream inputStream = new ByteArrayInputStream(out.toByteArray())) {
Core.storeFileDocumentContent(Context, OutputFile.getMendixObject(), inputStream);
}
return OutputFile;
}
}
Hope this will helps you