я могу создать PDF-файл с очень большой таблицей, в то время как размер временного файла увеличивается при очистке и остается пространство кучи константа.
Мне нужно создать файл PDF/A, но очистка не происходит, PDF встроен в память, достигая максимального размера кучи и вызывая переполнение.
В журнале PDF/A отображается следующее предупреждение
Код: Выделить всё
com.itextpdf.pdfa.PdfADocument : Page flushing was not performed. Pages flushing in PDF/A mode works only with explicit calls to PdfPage#flush(boolean) with flushResourcesContentStreams argument set to true
Код: Выделить всё
PdfADocument pdf = new PdfADocument(new PdfWriter(tempfile), PdfAConformanceLevel.PDF_A_1B,
new PdfOutputIntent("Custom", "", null, "sRGB IEC61966-2.1",
resourceLoader.getResource("classpath:sRGB2014.icc").getInputStream()));
pdf.getCatalog().setLang(new PdfString("it-it"));
// if pdf is instantiated with the following line flushing happens, with PdfADocument flushing doesn't work!
// PdfDocument pdf = new PdfDocument(new PdfWriter(tempfile));
Document document = new Document(pdf,PageSize.A4,true);
Подробнее здесь: https://stackoverflow.com/questions/787 ... able-pdf-a
Мобильная версия