I have created a form using the form API to submit some values needed to generate a pdf. However, the submit handler does not view the pdf, but just displays the form again.
However, it does not work. What am I doing wrong in the submit handler, as it does not seem to return the pdf. It just repeats the form again? See it in action on http://vih.dk/kalender/pdf
/**
* Implements hook_menu()
*/
function vih_kalendersiden_menu() {
$items = array();
$items['kalender/pdf'] = array(
'title' => 'PDF',
'page callback' => 'vih_kalendersiden_view',
'page arguments' => array(),
'access callback' => 'vih_kalendersiden_access',
'access arguments' => array(),
'type' => MENU_LOCAL_ACTION,
);
return $items;
}
/**
* Checks permissions
*
* Everybody should be able to get the pdf
*/
function vih_kalendersiden_access() {
return true;
}
function vih_kalendersiden_view() {
return drupal_get_form('vih_kalendersiden_form');
}
function vih_kalendersiden_form($form_state) {
$form['vih_kalendersiden'] = array(
'#type' => 'fieldset',
'#title' => t('Settings for the PDF calendar'),
'#tree' => TRUE,
);
$months = array(
1 => t('January'),
2 => t('February'),
3 => t('March'),
4 => t('April'),
5 => t('May'),
6 => t('June'),
7 => t('July'),