You are here

function pdf_to_imagefield_file_placeholder in PDF to ImageField 6.2

Same name and namespace in other branches
  1. 7 pdf_to_imagefield.module \pdf_to_imagefield_file_placeholder()

Construct the data object needed to insert into the files table.

Util to assist file attaching.

Parameters

string filepath:

Return value

object describing the file

2 calls to pdf_to_imagefield_file_placeholder()
pdf_to_imagefield_generate_page in ./pdf_to_imagefield.module
Generate a single page for the given pdf file-source, according to the field settings.
pdf_to_imagefield_save_file in ./pdf_to_imagefield.module
Save created image to files table.

File

./pdf_to_imagefield.module, line 423
PDF to ImageField core hooks and menu callbacks.

Code

function pdf_to_imagefield_file_placeholder($filepath) {
  global $user;
  $image = (object) array(
    'filename' => basename($filepath),
    'filepath' => $filepath,
    'filemime' => file_get_mimetype($filepath),
    'filesize' => filesize($filepath),
    'status' => 1,
    'timestamp' => time(),
    'uid' => $user->uid,
    'list' => FALSE,
  );
  return $image;
}