PdfPig
PdfPig copied to clipboard
Question: Is PdfDocument objects and others are thread-save?
I mean: if 2 separate threads each call pdfDocument.Open and then process the stream:
- Is it safe
- will they share any kind of "state"?
- will there be 2 different instances of PDF data that each thread will work on?
While a PdfDocument instance is not thread safe I think 2 different PdfDocuments should be. There are some shared global caches for things like system fonts, CMap objects and Standard14 fonts I think each of these is thread safe.
Assuming you just call PdfDocument.Open and pass the file path apart from the globally shared data between all PDF files they will operate on separate instances.