You should not have to change any controller code. The code is already there.
In application/helpers/pdf_helper.php (I left out code)
function generate_quote_pdf($quote_id, $stream = true, $quote_template = null)
{
:
$CI->load->model('custom_fields/mdl_custom_fields');
:
// Get all custom fields
$custom_fields = array(
'quote' => $CI->mdl_custom_fields->get_values_for_fields('mdl_quote_custom', $quote->quote_id),
'client' => $CI->mdl_custom_fields->get_values_for_fields('mdl_client_custom', $quote->client_id),
'user' => $CI->mdl_custom_fields->get_values_for_fields('mdl_user_custom', $quote->user_id),
);
$data = array(
:
'custom_fields' => $custom_fields,
:
);
}
You have to change the PDFview file.
Then in application/views/quote_templates/pdf/InvoicePlane.php
Add this code. You may need to style as you wish
<!-- Custom fields -->
<?php foreach ($custom_fields as $custom_field): ?>
<?php if ($custom_field->custom_field_location != 1) {
continue;
} ?>
<?php print_field($this->mdl_quotes, $custom_field, $cv); ?>
<?php endforeach; ?>