News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

TCPDF ERROR: [Image] Unable to get image

Started by guru01, April 26, 2015, 21:44:42 PM

Previous topic - Next topic

guru01

Hello, am new to this forum and i am sorry if this post is in the wrong place.
I am having error with tcpdf for virtuemart 2.6.18 which id the latest vm 2 version. I am using Joomla 2.5.28 which is the latest version for joomla 2.
The error is TCPDF ERROR: [Image] Unable to get image: http://localhost/T3Fremework_ver_1_9/images/stories/virtuemart/shipment/shipment_name.png.
I have gone through the whole fixes on the internet but none sems to fix this bug. My vendor and shipment images are in jpg format.

There are two issues here;
1 - The file is pointing to the wrong image file which does not exist.
2 - The file is also pointing to the wrong installation directory.

My curl works file and also file_get_contents.
NOTE: The sample pdf works fine, but when i want to generate for order it shows that error.

Hoping this can be resolved.
Thanks.

guru01

Any tips on where to start looking will be appreciated.

guru01

Am getting close to solving this problem myself.
The issue is from the vmpdf.php file, i commented the replace variable and just pass in manual html and it worked fine.
See screenshot

guru01

Here is the html source i got when i output the ob_get_contents.
<body onload="javascript:print();">

<div class='spaceStyle'>
   
<h1>Invoice 15042628302 </h1>

<table width="100%" cellspacing="0" cellpadding="0" border="0">
    <tr>
<td class="">Invoice date</td>
<td align="left">2015-04-26</td>
    </tr>
    <tr>
<td class="">Delivery Date</td>
<td align="left">Same as invoice date</td>
</tr>
    <tr>
<td >Order Number</td>
<td align="left"><strong>
    a71103 </strong>
</td>
    </tr>

    <tr>
<td class="">Order Date</td>
<td align="left">2015-04-26</td>
    </tr>
    <tr>
<td class="">Order Status</td>
<td align="left">Pending</td>
    </tr>
    <tr>
<td class="">Shipment</td>
<td align="left"><span class="vmCartPaymentLogo" ><img align="middle" src="http://localhost/T3Fremework_ver_1_9/images/stories/virtuemart/shipment/shipment_name.png"  alt="shipment_name" /></span>  <span class="vmshipment_name">Shipment Name</span><span class="vmshipment_description"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eu nulla a libero placerat fringilla. Aliquam sed libero iaculis, vulputate purus a, interdum dolor.</p>
<p>Nam vehicula sapien eu purus ultricies, ornare accumsan turpis laoreet. Sed ornare placerat eros, eget aliquet libero feugiat sit amet.</p></span></td>
    </tr>
    <tr>
<td class="">Payment Method</td>
<td align="left"><span class="vmCartPaymentLogo" ><img align="middle" src="http://localhost/T3Fremework_ver_1_9/images/stories/virtuemart/payment/payment_method.png"  alt="payment_method" /></span>  <span class="vmpayment_name">Payment Method</span><span class="vmpayment_description"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam aliquet massa et dictum gravida. Suspendisse iaculis neque eu arcu mollis eleifend.</p></span><br />lorem ipsum dolor </td>
    </tr>
     <tr>
<td class="orders-key"><strong>Total</strong></td>
<td class="orders-key" align="left"><strong>$1,050.00</strong></td>
    </tr>

    <tr>
<td colspan="2"></td>
    </tr>
    <tr>
<td valign="top"><strong>
    Bill To</strong> <br/>
    <table border="0"><tr><td class="key">E-Mail</td><td>bestoptionsstores@gmail.com</td></tr><tr><td class="key">Title</td><td>Mr</td></tr><tr><td class="key">First Name</td><td>King</td></tr><tr><td class="key">Last Name</td><td>Josiah</td></tr><tr><td class="key">Address 1</td><td>Concept Plaza, 54C 5th Avenue, Gwarinpa</td></tr><tr><td class="key">Phone</td><td>08023345667</td></tr></table>
</td>
<td valign="top" ><strong>
    Ship To</strong><br/>
    <table border="0"><tr><td class="key">First Name</td><td>King</td></tr><tr><td class="key">Last Name</td><td>Josiah</td></tr><tr><td class="key">Address 1</td><td>Concept Plaza, 54C 5th Avenue, Gwarinpa</td></tr><tr><td class="key">Phone</td><td>08023345667</td></tr></table>
</td>
    </tr>
</table>
</div>

<div class='spaceStyle'>
    <table class="html-email" width="100%" cellspacing="0" cellpadding="0" border="0">
<tr align="left" class="sectiontableheader">
<td align="left" width="5%"><strong>SKU</strong></td>
<td align="left" colspan="2" width="38%" ><strong>Product Name</strong></td>
<td align="center" width="10%"><strong>Product status</strong></td>
<td align="right" width="10%" ><strong>Price</strong></td>
<td align="right" width="6%"><strong>Qty</strong></td>
<td align="right" width="11%"><strong>Discount</strong></td>
<td align="right" width="11%"><strong>Total</strong></td>
</tr>

<tr valign="top">
<td align="left">
BCC </td>
<td align="left" colspan="2" >
<div float="right" ><a href="http://localhost/bestoptionsstores/index.php?option=com_virtuemart&view=productdetails&virtuemart_category_id=33&virtuemart_product_id=21&Itemid=643">Cow Gate, Baby Cauliflower Cheese</a></div>
</td>
<td align="center">
Pending </td>
<td align="right"   class="priceCol" >
<span >$1,050.00</span><br /> </td>
<td align="right" >
1 </td>
<td align="right" class="priceCol" >
$0.00 </td>
<td align="right"  class="priceCol">
$1,050.00 </td>
</tr>

<tr><td colspan="7"></td></tr>
<tr class="sectiontableentry1">
<td colspan="6" align="right">Product prices result</td>

                        <td align="right"><span  class='priceColor2'>$0.00</span></td>
<td align="right">$1,050.00</td>
  </tr>




<tr>
<td align="right" class="pricePad" colspan="6"><span class="vmCartPaymentLogo" ><img align="middle" src="http://localhost/T3Fremework_ver_1_9/images/stories/virtuemart/shipment/shipment_name.png"  alt="shipment_name" /></span>  <span class="vmshipment_name">Shipment Name</span><span class="vmshipment_description"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur eu nulla a libero placerat fringilla. Aliquam sed libero iaculis, vulputate purus a, interdum dolor.</p>
<p>Nam vehicula sapien eu purus ultricies, ornare accumsan turpis laoreet. Sed ornare placerat eros, eget aliquet libero feugiat sit amet.</p></span></td>

<td align="right"></td>
<td align="right">$0.00</td>
</tr>

<tr>
<td align="right" class="pricePad" colspan="6"><span class="vmCartPaymentLogo" ><img align="middle" src="http://localhost/T3Fremework_ver_1_9/images/stories/virtuemart/payment/payment_method.png"  alt="payment_method" /></span>  <span class="vmpayment_name">Payment Method</span><span class="vmpayment_description"><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam aliquet massa et dictum gravida. Suspendisse iaculis neque eu arcu mollis eleifend.</p></span><br />lorem ipsum dolor</td>

<td align="right"></td>
<td align="right">$0.00</td>
</tr>

<tr>
<td align="right" class="pricePad" colspan="6"><strong>Total</strong></td>

<td align="right"><span class='priceColor2'>$0.00</span></td>
<td align="right"><strong>$1,050.00</strong></td>
</tr>

</table>
</div>
<br clear="all"/><br/>
    </body>






NOTE: I have changed the shipment methods and payment methods but its not reflecting here. It looks like vm is caching the old information.

What do i do?

guru01

I discover the issue if from the standard shipment and standard payment plugins after disabling them the invoice display fine.

guru01

How can i correct this errors in the plugins?

Milbo

Should I fix your bug, please support the VirtueMart project and become a member
______________________________________
Extensions approved by the core team: http://extensions.virtuemart.net/

guru01

Quote from: Milbo on April 29, 2015, 08:14:37 AM
Maybe this post helps you. https://forum.virtuemart.net/index.php?topic=117596.0
Sorry that didn't help.
The images here are the once inside the body of the invoice and not at the header for footer.
Why is it that the payment method and shipping method are still showing the default values. I have changed them but they are not reflecting on the invoice.

guru01

After doing a fresh install on joomla 3.x and vm3.x didnt notice the error, pdf now works fine.

Arjan7

Hmm.. have exact the same problem, but website is up and running. Can't just create a new fresh install of Joomla 3 and VM 3.x.
If I disable the shipment plugin, the PDF-creating works fine. Enabling the plugin again starts the error again.

Someone any idea?

giupit75

Problem is located inside db on the table _virtuemart_shipment_plg_weight_countries.
It contain reference to img and latin strings that you don't need.
Simply delete and they never come back