JavaScript controlled fixups - resources
Fixups have simple properties where the value is just a number or a piece of text, but often they also have complex properties where the value is an ICC Profile, a font, a curve, a preflight check... In general, these items are referred to as resources. When you're specifying such a fixup using JavaScript, there needs to be a way to tell pdfToolbox which resources you are going to use (or might use), because pdfToolbox needs to include such resources in the kfpx file if you export the fixup.
This is done using the second section in the "Arbitrary JavaScript controlled Fixups" fixup, the "Resources" section. When you create a new fixup, the text area of the "Resources" section looks this:
{
"adjust_dot_gain_curves" : [],
"checks" : [],
"color_conversion_policies" : [],
"create_white_plate_curves" : [],
"font_files" : [],
"font_substitution_policies" : [],
"icc_profiles" : [],
"icc_profiles_device_link" : [],
"icc_profiles_n_channel" : [],
"ink_to_spot_curves" : [],
"occd_view_setups" : [],
"output_intents" : [],
"place_content_templates" : [],
"place_file_templates" : [],
"spot_color_libraries" : []
}
Different properties in the JSON object in this section, refer to different property types. Each of them is an array, where it's possible to specify the name of the resource you're using.
Adding a resource
You can just type the name of the resource in the correct spot, using proper JavaScript syntax. If you do this, you need to make sure that:
- You're using the correct name, and write it in the way pdfToolbox will understand it,
- You're using a resource that exists in the current library.
A simpler way of doing this is using the 'i' button, and then selecting the proper menu item from the pop up menu:
For each type of resource, there is a specific menu item. Selecting it opens a dialog box that shows all resources of this type available in your current library. Pick the one(s) you want (you can use "shift"-select or "Ctrl/Cmd"-select to select multiple items), and pdfToolbox will add those resources to the corresponding property. When picking a PSOCoated profile for example, the "icc_profiles" property is changed to:
"icc_profiles" :
[
"PSO Coated v3"
],
Don't add resources you never use. All resources listed here are exported together with this fixup into a kfpx file, so to keep the file size of exported profiles small, you should only add those resources you actually use.