Display uploaded image in customized PDF

  • Posts: 5591
  • Karma: 118
  • Thank you received: 512

MarioPuco replied the topic: Display uploaded image in customized PDF

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

Satisfied with our Support ?
PayPal Tip
===============================================
Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#235403
  • rd
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 58
  • Thank you received: 2

rd replied the topic: Display uploaded image in customized PDF

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
#235405
Attachments:
  • Posts: 5591
  • Karma: 118
  • Thank you received: 512

MarioPuco replied the topic: Display uploaded image in customized PDF

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

Satisfied with our Support ?
PayPal Tip
===============================================
Need to renew Pro Support?
Buy Here!
===============================================
Satisfied?
Consider a membership!
===============================================
Like us on Facebook
===============================================
#235407
  • rd
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 58
  • Thank you received: 2

rd replied the topic: Display uploaded image in customized PDF

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
#235409
Attachments:
  • rd
  • Topic Author
  • Offline
  • Senior Boarder
  • Senior Boarder
  • Posts: 58
  • Thank you received: 2

rd replied the topic: Display uploaded image in customized PDF

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
#235503
Moderators: ForumSupporttomeperica
Time to create page: 0.451 seconds

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here

News and Updates

Get informed about new downloads, updates and more in our News and Updates newsletter.

All Extensions Subscription

Get 1 year access to all of our current and future products and 1 year of professional support -- 99€

No support per domain or website installation limits! Includes all of our current and future Joomla!® extensions, Joomla!® templates for the duration of your membership. This means, by purchasing an All Extensions Subscription you'll have it all covered!

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!

Community Reward

Help us to create new extensions and plugins! With only $5 you help us a lot and get unlimited download access to all of our products, professional support and even more. Get your reward now!

Read More Here