так как я изменил ввод этого изображения с локального пути, жестко закодированного в методе к объекту ImageDataFile в базе данных, у меня проблемы с распознаванием файла itext7.
Код: Выделить всё
try (ByteArrayOutputStream outputStream = new ByteArrayOutputStream()) {
PdfWriter writer = new PdfWriter(outputStream);
PdfDocument pdfDocument = new PdfDocument(writer);
pdfDocument.setDefaultPageSize(PageSize.A4);
Document document = new Document(pdfDocument);
float twocol1 = 280f;
float[] twocolwidth1 = {twocol1, twocol1};
float twocol = 200f;
float[] twoColumnWidth = {twocol, twocol};
ImageDataFile imageDataFileTopPage = imageRepos.findByName("goldencarrotImagekleinste.jpg")
.orElseThrow(() -> new ResourceNotFoundException("image not found"));
ImageData imageTopPageData = ImageDataFactory.create(imageDataFileTopPage.getImageData());
Image imageTopPage = new Image(imageTopPageData);
Подробнее здесь: https://stackoverflow.com/questions/785 ... -in-itext7
Мобильная версия