TOPIC:

Forms 7 months 3 weeks ago #238912

  • Topic Author
  • trucks79
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 14
  • Thanks: 0
I am still trying to see if this works for me.
what i am trying to do is-
create a series of forms that we can use at work to carry out monthly checks, almost all of the forms will consist of

Date box
approx 8-10 tick boxes for pre set questions
option to upload a couple of photos for evidence
signature

sounds simple but i need to be able to able to make sure that each form submitted is sent via email as a pdf and includes everything on the form including any pictures and signature rather than file attachment links.

can someone please advise how i can do this?

Please Log in or Create an account to join the conversation.

Forms 7 months 3 weeks ago #238925

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello,

Here crosstec.org/en/support/online-documenta...68-admin-emails.html it is explained how to set a PDF attachment to be sent along with an email after the form is submitted.

You can change the looks of the PDF by alternating the pdf template as explained here crosstec.org/en/support/online-documenta...-s-pdf-template.html .

Here is the code for the template that should show images and signature in the PDF as you have explained:
<?php
/**
 * BreezingForms - A Joomla Forms Application
 * @version 1.8
 * @package BreezingForms
 * @copyright (C) 2008-2012 by Markus Bopp
 * @license Released under the terms of the GNU General Public License
 **/
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
// IMPORTANT!
// Supported Tags: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small
?>
<table border="1" width="100%">
	<tr>
		<td colspan="2" bgcolor="#cccccc" align="left" valign="middle">
			<h2><?php echo $this->submitted; ?></h2>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_ID') ?>:</strong>
		</td>
		<td>
			<?php echo $this->form; ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_PROCESS_SUBMITTEDAT') ?>:</strong>
		</td>
		<td>
			<?php echo $this->submitted; ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_IP') ?>:</strong>
		</td>
		<td>
			<?php echo $this->ip; ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_BROWSER') ?>:</strong>
		</td>
		<td>
			<?php echo htmlentities($this->browser, ENT_QUOTES, 'UTF-8');  ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_PROCESS_OPSYS') ?>:</strong>
		</td>
		<td>
			<?php echo htmlentities($this->opsys, ENT_QUOTES, 'UTF-8');  ?>
		</td>
	</tr>
	<tr>
		<td colspan="2" bgcolor="#cccccc">
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_DATA') ?>:</strong>
		</td>
	</tr>
	<?php
	if (count($xmldata)){
		foreach ($xmldata as $data) {
			?>
			<tr>
				<td>
					<strong>   <?php echo wordwrap(htmlentities($data[_FF_DATA_TITLE], ENT_QUOTES, 'UTF-8'), 40, '<br />', true); ?>:</strong>
				</td>
				<td>

					<?php if( $data[_FF_DATA_TYPE] == "File Upload" ) {
						 $image = nl2br(htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8'));
                echo '<img src="' . $image . '" width="150" height="150" border="0"/> ' ; 
					}

					else { echo $data[_FF_DATA_TYPE] == 'Signature' && file_exists(JPATH_SITE.'/media/breezingforms/signatures/'.$data[_FF_DATA_VALUE]) ? '<img src="'.JPATH_SITE.'/media/breezingforms/signatures/'.$data[_FF_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')); } 
					 ?> 
				</td>
			</tr>
			<?php
		}
	}
	?>
</table>

I'm also sending you an example of a PDF generated for a test form using this code.


Let me know whether this is what you wanted to achieve.

Regards,

Mihaela
Attachments:
The following user(s) said Thank You: trucks79

Please Log in or Create an account to join the conversation.

Forms 7 months 3 weeks ago #238938

  • Topic Author
  • trucks79
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 14
  • Thanks: 0
thanks mate i am now getting an error?

TCPDF ERROR: [Image] Unable to get the size of the image: /var/www/vhosts/jpsdocportal.co.uk/httpdocs/media/breezingforms/signatures/

Please Log in or Create an account to join the conversation.

Forms need help ;( 7 months 3 weeks ago #238941

  • Topic Author
  • trucks79
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 14
  • Thanks: 0
thanks, the screen shot you sent is perfect!
however i cant get it to work, i have removed and reinstalled breezing forms as i think i deleted some scripts in error

so so i replace all the code in the pdf_attachment file with the code that you put?

mihaela wrote: Hello,

Here crosstec.org/en/support/online-documenta...68-admin-emails.html it is explained how to set a PDF attachment to be sent along with an email after the form is submitted.

You can change the looks of the PDF by alternating the pdf template as explained here crosstec.org/en/support/online-documenta...-s-pdf-template.html .

Here is the code for the template that should show images and signature in the PDF as you have explained:

<?php
/**
 * BreezingForms - A Joomla Forms Application
 * @version 1.8
 * @package BreezingForms
 * @copyright (C) 2008-2012 by Markus Bopp
 * @license Released under the terms of the GNU General Public License
 **/
defined('_JEXEC') or die('Direct Access to this location is not allowed.');
// IMPORTANT!
// Supported Tags: h1, h2, h3, h4, h5, h6, b, u, i, a, img, p, br, strong, em, font, blockquote, li, ul, ol, hr, td, th, tr, table, sup, sub, small
?>
<table border="1" width="100%">
	<tr>
		<td colspan="2" bgcolor="#cccccc" align="left" valign="middle">
			<h2><?php echo $this->submitted; ?></h2>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_ID') ?>:</strong>
		</td>
		<td>
			<?php echo $this->form; ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_PROCESS_SUBMITTEDAT') ?>:</strong>
		</td>
		<td>
			<?php echo $this->submitted; ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_IP') ?>:</strong>
		</td>
		<td>
			<?php echo $this->ip; ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_BROWSER') ?>:</strong>
		</td>
		<td>
			<?php echo htmlentities($this->browser, ENT_QUOTES, 'UTF-8');  ?>
		</td>
	</tr>
	<tr>
		<td>
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_PROCESS_OPSYS') ?>:</strong>
		</td>
		<td>
			<?php echo htmlentities($this->opsys, ENT_QUOTES, 'UTF-8');  ?>
		</td>
	</tr>
	<tr>
		<td colspan="2" bgcolor="#cccccc">
			<strong><?php echo BFText::_('COM_BREEZINGFORMS_DATA') ?>:</strong>
		</td>
	</tr>
	<?php
	if (count($xmldata)){
		foreach ($xmldata as $data) {
			?>
			<tr>
				<td>
					<strong>   <?php echo wordwrap(htmlentities($data[_FF_DATA_TITLE], ENT_QUOTES, 'UTF-8'), 40, '<br />', true); ?>:</strong>
				</td>
				<td>

					<?php if( $data[_FF_DATA_TYPE] == "File Upload" ) {
						 $image = nl2br(htmlentities(substr(is_array($data[_FF_DATA_VALUE]) ? implode('|',$data[_FF_DATA_VALUE]) : $data[_FF_DATA_VALUE],0,10000), ENT_QUOTES, 'UTF-8'));
                echo '<img src="' . $image . '" width="150" height="150" border="0"/> ' ; 
					}

					else { echo $data[_FF_DATA_TYPE] == 'Signature' && file_exists(JPATH_SITE.'/media/breezingforms/signatures/'.$data[_FF_DATA_VALUE]) ? '<img src="'.JPATH_SITE.'/media/breezingforms/signatures/'.$data[_FF_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')); } 
					 ?> 
				</td>
			</tr>
			<?php
		}
	}
	?>
</table>

I'm also sending you an example of a PDF generated for a test form using this code.


Let me know whether this is what you wanted to achieve.

Regards,

Mihaela

Please Log in or Create an account to join the conversation.

Forms need help ;( 7 months 1 week ago #239026

  • Topic Author
  • trucks79
  • Offline
  • Fresh Breezer
  • Fresh Breezer
  • Posts: 14
  • Thanks: 0
Thanks again, the issue I am getting is any pictures uploaded are too big for the box section and over shoots the box?

How can I set it so it resizes the picture to fit the box ? Like in your example

Please Log in or Create an account to join the conversation.

Forms need help ;( 7 months 1 week ago #239048

  • mihaela
  • Offline
  • Developer
  • Developer
  • Posts: 3128
  • Karma: 105
  • Thanks: 415
Hello,

This part should resize the pictures to fit:
echo '<img src="' . $image . '" width="150" height="150" border="0"/> ' ;

Is that not having effect?

Regards,

Mihaela

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.098 seconds

BreezingForms Pro 1.4.7 for WordPress Released!

Available in the membership section.

Summer Sale!

Massive discounts on all subscriptions!

Get Your Subscription Here

Quick Links

Downloads

BreezingForms

ContentBuilder

BreezingCommerce

Templates

Documentation

BreezingForms

ContentBuilder

BreezingCommerce

Apprendre BreezingForms (French Community)

Apprendre et maîtriser BreezingForms par des tutoriels et exemples, le tout en français

breezingforms.eddy-vh.com

Questions et réponses sur les forums de l'AFUJ

AFUJ

Special Offer

Summer Sale! All subscriptions at a special price!

Includes prio support, all of our current and future Joomla!® extensions and Joomla!® templates for the duration of your membership.

Get it from here

3rd Party Discount - 25% Off

We help you to keep your costs under control. If you are a new member and purchased a form building tool from a different form vendor, then you'll get a 25% discount on our subscription plans.

How to receive the discount:

Send us a quick email to sales@crosstec.org with a proof of purchase (for example a paypal receipt), await payment instructions and enjoy your membership!