No, it’s not thread safe. Nor is it safe to share a PDTrueTypeFont across multiple PDDocument instances.
Read-only access to PDFs is “mostly” thread safe now, though we promise nothing, however write-access to PDFs is definitely not. — John > On 8 Oct 2015, at 02:59, M. Niedermair <[email protected]> wrote: > > Hello there, > > I load the font "Linux Libertine" in a factory as a singleton (I create > several hundred PDFs with this font.). > > libertine_R = PDTrueTypeFont.loadTTF(document, > FontLibertine.class.getResourceAsStream("ttf/LinLibertine_Rah.ttf")); > > In single-threaded, this also works without problems. > But if I start multiple threads that use the Font singelton, there is an > error. I run four threads per core (4x8 = 32). > > As a stopgap, I load the font in each thread individually. > Is there a better solution? > > Michael > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] >

