function pdf_to_imagefield_cron in PDF to ImageField 6
Implementation of hook_cron().
File
- ./
pdf_to_imagefield.module, line 44 - PDF to ImageField core hooks and menu callbacks.
Code
function pdf_to_imagefield_cron() {
$result = db_query_range('SELECT * FROM {pdf_to_imagefield} WHERE finished = 0', variable_get('pdf_to_imagefield_convert_pdf', 1), 0, 1);
while ($file = db_fetch_object($result)) {
$pdf = field_file_load($file->fid);
foreach (filefield_get_field_list(NULL, $file->field) as $fieldname => $field) {
$images = pdf_to_imagefield_convert_pages($file, pdf_to_imagefield_widget_file_path($field), $pdf);
pdf_to_imagefield_save_converted($images, $field, $pdf);
}
}
}