Storing PCL5 permanent resources
PCL5 allows certain resources to be set as permanent. Mako 7.0 introduced support for permanent resources, allowing different types of resources that may be marked as permanent (fonts, symbol sets and macros) to survive a printer reset/UEL command in the PCL stream.
📘 Example
A feature added to IPCL5Input
in Mako 7.4.0 enables it to get/set a reference to an object to be used for storing PCL5 permanent resources. While it is possible to achieve by keeping a pointer to an IPCL5Input
, there are situations where these resources need to be shared between input classes. A specific example is when using a PJL parser to create IPCL5Inputs
in unencapsulated mode, where a printer reset/UEL may return to PJL and then later execute another PCL5 stream that requires resources from an earlier stream. IPRNInput
works this way.
A new API, IPCL5Input::setPermanentResourceStore()
can be used for this. Passing a reference to a null IRCObjectPtr
initializes the object so that it can be used with another IPCL5Input
. A simple example when using with PJL might be:
IRCObjectPtr resources;
if (pjlParser->parse(pushbackStream) == CPjlParser::ePREnterPcl)
{
IPCL5InputPtr pclInput = IPCL5Input::create(jawsMako);
pclInput->enableUnencapsulatedMode(true);
pclInput->setPermanentResourceStore(resources);
IDocumentAssemblyPtr assembly = pclInput->open(pushbackStream);
...
}
// resources now points to an object that holds permanent resources.
if (pjlParser->parse(pushbackStream) == CPjlParser::ePREnterPcl)
{
IPCL5InputPtr pclInput = IPCL5Input::create(jawsMako);
pclInput->enableUnencapsulatedMode(true);
// Pass the permanent resources to a newly created IPCL5Input.
pclInput->setPermanentResourceStore(resources);
IDocumentAssemblyPtr assembly = pclInput->open(pushbackStream);
...
}