PDF-файл, созданный с использованием itextpdf и Spring Boot 3.2.0, становится недействительным после загрузки, но работаJAVA

Программисты JAVA общаются здесь
Ответить
Гость
 PDF-файл, созданный с использованием itextpdf и Spring Boot 3.2.0, становится недействительным после загрузки, но работа

Сообщение Гость »


After migrating from SB2.5 to SB3.2 PDF generated using itext7-core:7.2.2 becomes invalid after download but it is working fine in SB2.5.
In SB3.2, I am able to view the pdf in browser and there is no issues with its content but when I download the pdf its coming without any extention and even if i download the file and give the extention manually and open using Adobe reader it gives an error ""Adobe Reader could not open xxx.pdf because it is either not a supported file type or because the file has been damaged"
The main changes I made for the migration(SB2.5>sb3.2) in the class where pdf creation code exists is replacing javax to jakarta, mainly javax.servlet.http.HttpServletResponse to jakarta.servlet.http.HttpServletResponse
I dont think there is any issue with the pdf generation code(how i am using itext library) because it is working in SB2.5.
If anyone has worked on this/ faced this issue and remediated please let me know.


Источник: https://stackoverflow.com/questions/781 ... er-downloa
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «JAVA»