I want to see a specific fields and in a different format. Do you know how I can call a specific field (not all fields) using php for example?
This requires to edit the pdf_attachment.php but I would suggest you use an alternate template.
Please copy the file /media/breezingforms/pdftpl/pdf_attachment.php under the same location and name it FORMNAME_pdf_attachment.php. Replace FORMNAME with the name of your form. BF will then pick it automaticaly and it is protected from BF upgrades.
Here is an example how you could perform custom layouts and selecting on the fields that you need:
Replace this in the pdf attachement template:
<?php if (count($xmldata)){ foreach ($xmldata as $data) { ?> <table> <tr> <td> <strong><?php echo htmlentities($data[_FF_DATA_TITLE], ENT_QUOTES, 'UTF-8'); ?>:</strong> </td> <td> <?php echo nl2br(htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8')); ?> </td> </tr> </table> <?php } } ?>
With this (example with name and email fieldnames):
<?php $name = ''; $email = ''; if (count($xmldata)){ foreach ($xmldata as $data) { $value = nl2br(htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8')); switch($data[_FF_DATA_NAME]){ case 'name': $name = $value; break; case 'email': $email = $value; break; } } } ?> <table> <tr> <td> <strong>Name:</strong> </td> <td> <?php echo $name; ?> </td> </tr> <tr> <td> <strong>Email:</strong> </td> <td> <?php echo $email; ?> </td> </tr> </table>
This will only render the fields "name" and "email" with your desired layout.
Additionally you can remove the head data or parts of it if you don't need it.