Printing optional images

Hello,

We create a template with the Designer where we have e.g. 6 Drawing type variables: Vehicle.Image_0, Vehicle.Image_1, …, Vehicle.Image_5.

Then we print using this template with List&Label Cross Platform. There are cases when a vehicle has less than 6 images. In this case an empty string is set as a variable value.

The application will show warnings and an error for each empty image:

PropertyDrawingContents.GetDrawingContentsFromHybridFile → Failed to get drawing contents from hybrid file .

PropertyDrawingContents.GetImageDimensions → Failed to get image dimensions.

HybridFileHelper.GetHybridFileStream → Failed due to unknown type. ‘’

We tried these options when adding the variable before print but all shows the mentioned lines in the logs:

listLabel.Variables.Add("Vehicle.Image_5", "");

listLabel.Variables.Add("Vehicle.Image_5", "", LlFieldType.Drawing);

listLabel.Variables.Add("Vehicle.Image_5", null, LlFieldType.Drawing);

The printing works fine, the pdf is created and contains the expected result.
Should we then just ignore these logs or do we use something incorrectly?

Thanks in advance,
Andras

For now, you can safely ignore the warnings, LLCP is trying to open a file with empty file name which obviously doesn’t work. We’ll make sure to tackle this in one of the coming builds.

1 Like

Update: We’ve uploaded a new package to our prerelease server. This update stops logging errors and warnings, though the functionality remains unchanged and still produces an empty picture as expected. If you prefer cleaner logs, we recommend updating. This improvement will also be included in the next release, expected in January.