prepare method
Prepare the object to be written to the stream
Implementation
@override
void prepare() {
super.prepare();
// This holds any resources for this FormXObject
final resources = PdfDict();
// fonts
if (fonts.isNotEmpty) {
resources['/Font'] = PdfDict.fromObjectMap(fonts);
}
// Now the XObjects
if (xobjects.isNotEmpty) {
resources['/XObject'] = PdfDict.fromObjectMap(xobjects);
}
if (resources.isNotEmpty) {
params['/Resources'] = resources;
}
}