function pdf_to_image_source_fields in PDF to ImageField 7.3
Returns field names used as source files for pdf conversion.
Parameters
string $entity_type: Eg 'node'.
string $bundle: Eg 'document'.
Return value
array List of field names.
3 calls to pdf_to_image_source_fields()
- pdf_to_image_entity_update in ./
pdf_to_image.module - When a fieldable entity is being updated, regenerate the files.
- pdf_to_image_form_alter in ./
pdf_to_image.module - Implements hook_form_alter().
- pdf_to_image_tokens in ./
pdf_to_image.module - Fills in a token with the filename of the source pdf.
File
- ./
pdf_to_image.module, line 266 - Generates thumbnail image(s) from an uploaded PDF.
Code
function pdf_to_image_source_fields($entity_type, $bundle) {
// Find if this entity has any fields that use the pdf_to_image widget.
$fields = field_info_instances($entity_type, $bundle);
$pdf_fields = array();
foreach ((array) $fields as $field) {
if ($field['widget']['type'] == 'pdf_to_image') {
$pdf_fields[$field['field_name']] = $field;
}
}
return $pdf_fields;
}