You are here

function print_pdf_tcpdf_settings in Printer, email and PDF versions 7.2

Form constructor for the TCPDF options settings form.

1 string reference to 'print_pdf_tcpdf_settings'
print_pdf_tcpdf_menu in print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.module
Implements hook_menu().

File

print_pdf/lib_handlers/print_pdf_tcpdf/print_pdf_tcpdf.admin.inc, line 18
Contains the administrative functions of the print_pdf_tcpdf sub-module.

Code

function print_pdf_tcpdf_settings() {
  $form['settings'] = array(
    '#type' => 'fieldset',
    '#title' => t('TCPDF options'),
  );
  $form['settings']['print_pdf_font_family'] = array(
    '#type' => 'textfield',
    '#title' => t('Font family'),
    '#default_value' => variable_get('print_pdf_font_family', PRINT_PDF_TCPDF_FONT_FAMILY_DEFAULT),
    '#size' => 60,
    '#maxlength' => 250,
    '#description' => t('Set the font family to be used. Examples: %examples.', array(
      '%examples' => 'helvetica, times, courier, dejavusans, dejavuserif, freesans, freeserif, freemono',
    )) . '<br />' . t("CAUTION: TCPDF embeds the complete font in the generated PDF. If you're not using Unicode, then helvetica or times are safe choices that will keep the PDF small. Unicode fonts can increase the size of the PDF to the 1MB region."),
  );
  $form['settings']['print_pdf_font_size'] = array(
    '#type' => 'textfield',
    '#title' => t('Font size'),
    '#default_value' => variable_get('print_pdf_font_size', PRINT_PDF_TCPDF_FONT_SIZE_DEFAULT),
    '#size' => 2,
    '#maxlength' => 3,
    '#description' => t('Set the font size to be used for normal text. This is the base value for the scaling applied to other text styles.'),
  );
  $form['settings']['print_pdf_font_subsetting'] = array(
    '#type' => 'checkbox',
    '#title' => t('Enable font subsetting'),
    '#default_value' => variable_get('print_pdf_font_subsetting', PRINT_PDF_TCPDF_FONT_SUBSETTING_DEFAULT),
    '#description' => t('Only embed those font characters that are actually used.  This can generate smaller PDF files but may significantly slow down processing.'),
  );
  $form['#validate'][] = '_print_pdf_tcpdf_settings_validate';
  return system_settings_form($form);
}