TOPIC:

Display uploaded image in customized PDF 1 year 3 months ago #235403

  • MarioPuco's Avatar
  • MarioPuco
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 5958
  • Karma: 119
  • Thanks: 554
Hey there,

You will need to create a variable for each upload element + loop it through the switch case + echo each upload element like so:
<tr>
<?php
$upload = '';
$upload1 = '';
$upload2 = '';

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 'image1':
          $upload = $value;
          break;
      case 'image2':
          $upload1 = $value;
          break;
      case 'image3':
          $upload2 = $value;
          break;
      }
    }
}
?>
<td>
<img src="<?php echo $upload; ?>" width="150" />
</td>
<td>
<img src="<?php echo $upload1; ?>" width="150" />
</td>
<td>
<img src="<?php echo $upload2; ?>" width="150" />
</td>
</tr>

Pleae test it and let me know if it works.

Regards,
Mario

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

Last edit: Post by MarioPuco.

Display uploaded image in customized PDF 1 year 3 months ago #235405

  • Topic Author
  • rd
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 152
  • Thanks: 2
Hi Mario,

With your code, only the first of 3 images is beeing submitted.

I do not understand the logic behind this. Where do I define upload, upload1, upload2 in breezingforms? I thought, "upload" is the general name of the upload element and it can't be changed.

Please see the attachments and show me where to enter upload, upload1 and upload3.


Regards,
Rolf
Attachments:

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

Display uploaded image in customized PDF 1 year 3 months ago #235407

  • MarioPuco's Avatar
  • MarioPuco
  • Offline
  • Ultimate Breezer
  • Ultimate Breezer
  • Posts: 5958
  • Karma: 119
  • Thanks: 554
Since you are using HTML5 upload thigns will get a bit different.
I understood your that you have multiple FLASH uploads and not ONE HTML5.
Please look into this : crosstec.org/en/forums/3-breezingforms-f...d-in-pdf.html#194438

Regards,
Mario

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

Display uploaded image in customized PDF 1 year 3 months ago #235409

  • Topic Author
  • rd
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 152
  • Thanks: 2
Hi Mario,

Since you are using HTML5 upload thigns will get a bit different.
I understood your that you have multiple FLASH uploads and not ONE HTML5.

I checked this out. It had no effect on the result. Both, the Standard upload ELement and the Single HTML5 Upload Element produce the same result.

Please look into this : crosstec.org/en/forums/3-breezingforms-f...d-in-pdf.html#194438

I played around with this. And I manage to get 3 Images beeing displayed in my PDF, but not the way it should be. Each Image should be displayed in one row after each other according to the HTML-Code:
<tr
<td>Image1</td>
</tr>
<tr>
<td>Image2</td>
</tr>
<tr>
<td>Image3</td>
</tr>

But they are not. They are shown this way and doubled in a strange manner:
Image1 Image2 Image3
Image1 Image2 Image3
Image1 Image2 Image3

File Attachment:

File Name: ffexport-p....pdf.zip
File Size:130 KB


Here is the code I am using:
<tr>
<td>
<?php
if (count($xmldata)){
   foreach ($xmldata as $data) {
   	if ($data[_FF_DATA_NAME] = 'image1'){
		$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="100" border="0"/> ' ;  		
      		
      	}    		
     }
}
?>
</td>
</tr>

<tr>
<td>
<?php
if (count($xmldata)){
   foreach ($xmldata as $data) {
   	if ($data[_FF_DATA_NAME] = 'image2'){
		$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="100" border="0"/> ' ;  		
      		
      	}    		
     }
}
?>
</td></tr>
<tr>
<td>
<?php
if (count($xmldata)){
   foreach ($xmldata as $data) {
   	if ($data[_FF_DATA_NAME] = 'image3'){
		$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="100" border="0"/> ' ;  		
      		
      	}    		
     }
}
?>
</td></tr>


And if I add an extra td for a title only the title is beeing displayed but no images.

File Attachment:

File Name: onlytitlen....pdf.zip
File Size:106 KB


here the code with the extra td for the title:
<tr>
<td>Title</td>
<td>
<?php
if (count($xmldata)){
   foreach ($xmldata as $data) {
   	if ($data[_FF_DATA_NAME] = 'image1'){
		$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="100" border="0"/> ' ;  		
      		
      	}    		
     }
}
?>
</td>
</tr>

<tr>
<td>Title</td>
<td>
<?php
if (count($xmldata)){
   foreach ($xmldata as $data) {
   	if ($data[_FF_DATA_NAME] = 'image2'){
		$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="100" border="0"/> ' ;  		
      		
      	}    		
     }
}
?>
</td></tr>
<tr>
<td>Title</td>
<td>
<?php
if (count($xmldata)){
   foreach ($xmldata as $data) {
   	if ($data[_FF_DATA_NAME] = 'image3'){
		$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="100" border="0"/> ' ;  		
      		
      	}    		
     }
}
?>
</td></tr>

Regards,
Rolf
Attachments:

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

Display uploaded image in customized PDF 1 year 3 months ago #235503

  • Topic Author
  • rd
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 152
  • Thanks: 2
Hello Mario,

have you had the time to read my last post?
Sorry for asking but we really need a solution for this because a lot of forms will use the functionality.

Thank you very much
Regards
Rolf

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

Display uploaded image in customized PDF -- solved 1 year 2 months ago #236510

  • Topic Author
  • rd
  • Offline
  • Senior Breezer
  • Senior Breezer
  • Posts: 152
  • Thanks: 2
Found a solution how to display uploaded images and signatures in customized pdf:
this is the code:
<?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
?>

<div align="center"><center>
<table width="100%" cellspacing="5px 2px 5px 5px" border="1">
<tr><td colspan="2"><h1>PDF mit Bildern und Unterschriften</h1></td></tr>
<tr><td align="left">Image Upload 1</td>
<td>
<?php
if (count($xmldata))
{
   foreach ($xmldata as $data) 
   {
      switch($data[_FF_DATA_NAME])
     {
        case 'image1':
                $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"/> ' ; 
                break;
      } 
   }
}
?>
</td>
</tr>
<tr><td align="left">Signature 1</td>
<td>
<?php
if (count($xmldata))
{
   foreach ($xmldata as $data) 
   {
      switch($data[_FF_DATA_NAME])
     {
        case 'signature1':
    echo $data[_FF_DATA_TYPE] == 'Signature' && file_exists(JPATH_SITE.'/media/breezingforms/signatures/'.$data[_FF_DATA_VALUE]) ? '<img width="150" height="150" 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')); 
                break;
      } 
   }
}
?>
</td>
</tr>
<tr>
<td align="left">Image Upload 2</td>
<td>
<?php
if (count($xmldata))
{
   foreach ($xmldata as $data) 
   {
      switch($data[_FF_DATA_NAME])
     {
        case 'image2':
    $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"/> ' ; 
                break;
      } 
   }
}
?>
</td>
</tr>
<tr>
  <td align="left">Signature 2</td>
<td>
<?php
if (count($xmldata))
{
   foreach ($xmldata as $data) 
   {
      switch($data[_FF_DATA_NAME])
     {
        case 'signature2':
    echo $data[_FF_DATA_TYPE] == 'Signature' && file_exists(JPATH_SITE.'/media/breezingforms/signatures/'.$data[_FF_DATA_VALUE]) ? '<img width="150" height="150" 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')); 
                break;
      } 
   }
}
?>
</td>
</tr>
</table>
</center></div>

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

  • Page:
  • 1
  • 2
Moderators: ForumSupport
Time to create page: 0.160 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!