You are here

function pdf_to_image_validate_density in PDF to ImageField 7.2

Same name and namespace in other branches
  1. 7.3 pdf_to_image.module \pdf_to_image_validate_density()

validate string for destiny settings

1 string reference to 'pdf_to_image_validate_density'
pdf_to_image_field_widget_settings_form in ./pdf_to_image.module
Implements hook_field_widget_settings_form().

File

./pdf_to_image.module, line 256
Implement a pdf field, based on the file module's file field.

Code

function pdf_to_image_validate_density($element, &$form_state) {
  $value = $element['#value'];
  if (!empty($value) && !preg_match('/^[0-9]+x[0-9]+$/', $value)) {
    form_set_error('density', t('Please specify a density in the format XxY (e.g. 120x120).'));
  }
}