RE: Re: OutOfMemoryError when drawing text containing spaces with PD0FontType

2025-05-26 Thread Maxime WIEWIORA
Hello, Oh! Thanks for pointing that out! My bad... my pdfbox dependency comes from quarkus-pdfbox 1.0.0 (using pdfbox 3.0.2) and I had a conflict with fontbox used by the apache-tika dependency. But during my tests, I didn't notice that I had only changed the fontbox version and not the pdfbox one

Re: OutOfMemoryError when drawing text containing spaces with PD0FontType

2025-05-26 Thread Tilman Hausherr
On 26.05.2025 20:55, Maxime WIEWIORA wrote: Maybe not decreasing the value of lastIndexOfPrevMatch when the CompoundCharacterTokenizer has been initialized via the constructor CompoundCharacterTokenizer(Pattern pattern) could be a solution That constructor is no longer used in PDFBox, that was

Re: OutOfMemoryError when drawing text containing spaces with PD0FontType

2025-05-26 Thread Tilman Hausherr
Hi, It doesn't happen with 3.0.5 either, here's the exact code I used:     try (PDDocument doc = new PDDocument())     {     File fontFile = new File("XXX/Inter.ttc");     TrueTypeCollection ttc = new TrueTypeCollection(fontFile);     var regularFont = PDType0Font

OutOfMemoryError when drawing text containing spaces with PD0FontType

2025-05-26 Thread Maxime WIEWIORA
Hello, Since pdfbox 3.0.2, we have an OutOfMemoryError when the method PDPageContentStream.showText(String) is used with a TrueType font (PD0FontType) to draw a text containing at least one space character. Here is an example of code causing the error: File fontFile = new File(ttcUrl.getFile());

Re: OutOfMemoryError when drawing text containing spaces with PD0FontType

2025-05-26 Thread Tilman Hausherr
Hi, Can you tell where to find this font, or can you reproduce it with a different (more ordinary) font? I tried with the font on https://rsms.me/inter/download/ and no problem with the file Inter.ttc in the zip file. I tried it with 3.0.6 (unreleased), but it also worked with 3.0.2. Tilma

RE: Re: OutOfMemoryError when drawing text containing spaces with PD0FontType

2025-05-26 Thread Maxime WIEWIORA
Hi, Sorry, I effectively wanted to say since 3.0.3 (I also got the error with 3.0.4 and 3.0.5, but indeed, it works with 3.0.2). The font I use is the one provided in the download page you mentioned. When using Helvetica font, the issue is not present. The difference is the "Inter" font has GSubDa