Теперь я хочу использовать его для преобразований .xlsx -> .pdf, но у меня возникли проблемы. У меня есть следующий код:
Код: Выделить всё
class OfficeToPdfConverter {
fun convert(input: File, output: File) = try {
LocalConverter.builder().build().convert(input).`as`(determineInput(input)).to(output)
.`as`(DocumentType.PDF)
.execute()
} catch (e: Exception) {
e.printStackTrace()
}
private fun determineInput(input: File) = when (input.extension) {
"docx" -> DocumentType.DOCX
"pptx" -> DocumentType.PPTX
"xlsx" -> DocumentType.XLSX
else -> DocumentType.DOCX
}
}
- Нет конвертера для преобразования application/vnd.openxmlformats-officedocument.presentationml. Доступна презентация в application/pdf
- Конвертер для преобразования application/vnd.openxmlformats-officedocument.presentationml.presentationml в application/pdf не доступен
Есть ли у кого-нибудь опыт работы с этим? и как мне это реализовать?
Подробнее здесь: https://stackoverflow.com/questions/726 ... ocuments4j
Мобильная версия