Is it possible to create code that works on MAC and Windows too (My concern is about MAC but if both platforms that would be great) to get data from predefined PDF form fields into predefined excel template?
If yes can you please provide simple exams of code to test?
kPMOutOfScope is just the name of the error (a definition or an enum; should be declared in PMError.h).
PMSessionEndDocumentNoDialog might be called by other printing related functions or by a library (which seems happened in your case). So it may be a bug in that library or your code calls (printing) functions from that library without follwing the library reference documentation.
There should be not so many code lines in your application that are printing related. I would start inspecting them for correct usage of functions by reading the documentation for the used functions. Add code to check function return values (if a start print / preparation function fails for example and you did not detect that but call other printing functions later, they will fail too which might include exceptions). If it is a third party library, contact the supplier or ask in a related forum.