No Alert - For Missing PDFs

Goodmorning,

For a customer we get new letters every week, like 20 or so, but they often forget to supply all letters.

We dont always check very well and Press will just generate the letters and skip them

Is there a way to get an error for missing PDFs? is it an option somewhere? That way we can make sure we always send out complete files and dont have to contact customers later that we’ve missed something

Thanks

Hello @TBaas,

To help you with the question asked, I would like to ask if you can you let us know please:

  1. How these letters are arriving; are they written to an input directory, for example?
  2. If these letters are picked up and processed by a Workflow process, or if they’re processed via the Designer
  3. If these letters are applies as PDF background

Hi Marten,

These arent used as PDF backgrounds, we make for every letter a section with a condition

An option is to run the fatalError(message)1 which triggers a fatal error that aborts content creation, when a condition isn’t met. An code example in which this function is used is present on the following webpage:
Dynamically adding sections (cloning) - OL Connect 2025.2 Help

1See fatalError(message) - OL Connect 2025.2 Help for more information.

Thanks for the reply Marten, will this also activate if we have made a hotfolder for it?

It depends. What does your current condition (script) look like?

The below Control script triggers a fatal error when a resource cannot be found.

Note: This script won’t trigger a fatal error but simply keeps the section disabled when the record field Letter is empty.

var section = merge.template.contexts.PRINT.sections["Section 1"],
	field = record.fields.Letter; // Example: Test.pdf

section.enabled = false;

if (field !== "") {
	// Example: file:///C:/Workspace/Input/Test.pdf
	if (resource("file:///C:/Workspace/Input/" + field)) {
		section.enabled = true;
	} else {
		fatalError("Letter '" + field + "' not found.");
	}
}

This is also very useful for us. As we had issue having red-crossed images on the centre of page if pdfs were missing.

My question, as I understand, this resource function is available only in Template scripting but not in Datamapper. Is there similar I’m not aware of, to do same thing in Datamapper so we can apply rules for the information being returned by this function (aside from Alambic api we’re using in workflow)?

@upland
I dont know what projects you guys are working on now, but from a customer point view i think many would like it if there was a checkbox somewhere to activate an error report with the output PDF of the files it couldnt find and perhaps any other issues the production encountered - record numbers and what was wrong maybe an idea for a future update? :slight_smile:

I think the only way now is to pro-actively look in the logs or not?

A possible solution is to apply something similar to the below and to send the job file to an error process1 when the fatal error occurs by executing the OL Connect plugin to which the template is applied.

1Using an error process provides the possibility to send an email to a supervisor indicating that a job has failed. See Creating and using Error processes - OL Connect Workflow 2026.1 Help for more information.