You are here

pdf.module in PDF 7

Same filename and directory in other branches
  1. 8 pdf.module
  2. 6 pdf.module

File

pdf.module
View source
<?php

/**
 * @file
 */
module_load_include('inc', 'pdf', '/includes/pdf.field');

/**
 * Implements hook_theme().
 */
function pdf_theme() {
  $theme = array(
    'pdf_formatter_default' => array(
      'variables' => array(
        'file' => NULL,
        'keep_pdfjs' => NULL,
        'width' => NULL,
        'height' => NULL,
      ),
      'file' => 'includes/pdf.field.inc',
    ),
    'pdf_formatter_thumbnail' => array(
      'variables' => array(
        'file' => NULL,
        'scale' => 1,
        'width' => NULL,
        'height' => NULL,
      ),
      'file' => 'includes/pdf.field.inc',
    ),
    'pdf_formatter_pages' => array(
      'variables' => array(
        'file' => NULL,
        'scale' => 1,
      ),
      'file' => 'includes/pdf.field.inc',
    ),
  );
  return $theme;
}

/**
 * Implements hook_libraries_info().
 */
function pdf_libraries_info() {
  $libraries = array();
  $libraries['pdf.js'] = array(
    'name' => 'pdf.js',
    'vendor url' => 'http://mozilla.github.io/pdf.js/',
    'download url' => 'http://mozilla.github.io/pdf.js/getting_started/#download',
    'version arguments' => array(
      'file' => 'build/pdf.js',
      'pattern' => "/(?:PDFJS\\.version|pdfjsVersion)\\s*=\\s*'(.*)'/",
      'lines' => 15000,
    ),
    'files' => array(
      'js' => array(
        'build/pdf.js',
      ),
    ),
    'variants' => array(
      'viewer' => array(
        'files' => array(
          'js' => array(
            'build/pdf.js',
            'web/l10n.js',
            'web/viewer.js',
          ),
        ),
      ),
      // DEV.
      'textlayer' => array(
        'files' => array(
          'js' => array(
            'build/pdf.js',
            'web/pdf_find_bar.js',
            'web/pdf_find_controller.js',
            'web/ui_utils.js',
            'web/text_layer_builder.js',
          ),
        ),
      ),
    ),
  );
  return $libraries;
}

Functions

Namesort descending Description
pdf_libraries_info Implements hook_libraries_info().
pdf_theme Implements hook_theme().