Closed lmtoo closed 2 years ago
Hi @lmtoo,
Indeed. Storing renditions as additional content on the entity is a goal. The basic plan I have is to indicate which renditions you want to store on an Entity (perhaps through additional @Content(mimeType="application/pdf")
annotations). The content would be converted the first time that rendition is accessed and returned as usual but also stored so that subsequent request for that rendition would not have to re-convert the content.
Entities may have different mimeTypes , for example Document may be doc/docx or xlsx. only doc/docx convert to pdf should be persist, and xlsx already exists a web preview solution , like sheetjs.
docx4j will convert docx to pdf if the request's Accept is application/pdf, but it will also slow the request , even for just 10 pages document, it will cost at least 30 seconds, if persist the conversion result when the first request, to will speed up subsequent request, also ,if original docx is changed ,auto cleanup conversion result.