Proximity: Object reaches into edge area of a shape
The property "Object reaches into edge area of a shape" is based on the concept that graphics objects on a PDF page can be checked whether they reach into the 'safety zone' of a shape. The shape is defined by means of a Shape property (for more details see the article "Shapes" property for use in "Context aware object detection" checks).
In the example shown further below, this shape is derived from a cutline that is expected to be present in the PDF file to be examined. Using the outer border of such a cutline it is possible to represent even relatively complex setups.
The 'safety zone' for the cutline is then established by two threshold values, one for objects inside the cutline, and the other one for objects outside of the cutline.
Last but not least it needs to be determined which objects to check against the safety zone of the cutline. In the example shown below, text objects are checked.
The configuration options for a check based on the "Object reaches into edge area of a shape" property can be seen below:
Sample files
The example below makes use of the check Text too close to "Cutline".kfpx and the PDF file Yummy Pumpkin Yoghurt.pdf which are available for download:
Create a check based on the "Object reaches into edge area of a shape" property
Inside the "Checks" window, select the "Create Check..." entry from the fly out menu.
The "Edit Check" window will open. In the "Group" list select the "Context aware object detection" entry, then in the "Property" list select the "Object reaches into edge area of a shape".
Click on the small "Add" button in the "Object reaches into edge area of a shape".
Below the "Group" and "Property" lists, a configuration area for the "Object reaches into edge area of a shape" property gets inserted, ready to be configured.
Make sure to fill out all applicable fields:
- choose a suitable name for the new check
- select an already existing check (or create a new one) that defines for which objects to check whether they are reaching into the edge area of a shape
- select an already existing shape (or create a new one) that defines a shape based on the page content or objects that represent the cutline (of course any other type of content or objects could be used as well)
- set the value for the minimal required distance for content reaching towards the "Cutline" shape's edge from the inside of the shape
- set the value for the minimal required distance for content reaching towards the "Cutline" shape's edge from the outside of the shape
- adjust the measurement unit as necessary; possible values are mm, pt and inch.
Make sure to save your new check by clicking the OK button. You can modify the check any time.
Testing whether the check works as expected
While editing a new or existing check there is an easy way to test whether the check actually does what it is intended to do.
Please install the attached check Text too close to "Cutline".kfpx and open the attached example file Yummy Pumpkin Yoghurt.pdf in order to follow the exercise below.
Open "Edit Check" window for the Text too close to "Cutline" check and click on the "Test" button.
In order to learn more about how the Test mode can speed up construction and adjustments of checks, but also profiles, process plans or fixups, please check out the chapter Test mode.
A Test profile window will open, with a dialog window on top of it with three fields where information can be entered.
These three field are shown, because the check in this example makes use of variables – variables can represent values that can be modified before executing a check. It is also acceptable to leave the values unmodified. In any case, click OK to trigger execution of the check.
The Test profile window will now display the file Yummy Pumpkin Yoghurt.pdf in the left half of its window, and the results from running the check on the right side.
By double clicking on the entries below the line saying Text too close to "Cutline" (2 matches) the respective objects can be highlighted on the page.
Double clicking on the first entry will highlight the character 'y' in the word 'your' towards the bottom of the label in the example PDF file.
In order to test the check with different values, simply click on the "Test" button in the "Test profile" window.
By entering a different value for the inside distance – 2mm instead of 1mm – more objects will be found.
As there are objects that are less than 2 mm, but more than 1 mm, away from the cutline, the check now finds 31 objects instead of just two.