You are here

function pdf_to_image_validate_density in PDF to ImageField 7.3

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

Validate string for density settings.

1 string reference to 'pdf_to_image_validate_density'
pdf_to_image_field_widget_settings_form in ./pdf_to_image.module
Adds options to the field configuration form in the content type admin setup.

File

./pdf_to_image.module, line 118
Generates thumbnail image(s) from an uploaded PDF.

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. 100x100).'));
  }
}