Forum


Replies: 3   Views: 3315
Cannot resolve picture url
Topic closed:
Please note this is an old forum thread. Information in this post may be out-to-date and/or erroneous.
Every phpdocx version includes new features and improvements. Previously unsupported features may have been added to newer releases, or past issues may have been corrected.
We encourage you to download the current phpdocx version and check the Documentation available.

Posted by anzai408  · 21-02-2014 - 10:41

Hi, I have a problem over here. The problem is when I trying to put the image source link to a pie chart generator, it unable to save that picture to the doc file.



For example,

$table = '<table style="border-collapse: collapse;">

                      <tr style="background-color:#9bbb59; color:red; font-weight: bold;">

                          <td>

                              <span style="font-family: Calibri; font-size: 21pt; background-color:none;">No</span>

                          </td>

                          <td>

                              <span style="font-family: Calibri; font-size: 21pt; background-color:none;">Test</span>

                          </td>

                          <td>

                              <span style="font-family: Calibri; font-size: 21pt; background-color:none;">Dest</span>

                          </td>

                      </tr>

                      <tr>

                          <td>

                              <span style="font-family: Calibri; font-size: 21pt">Just Try</span>

                          </td>

                          <td>

                              <span style="font-family: Calibri; font-size: 21pt">Just Try</span>

                          </td>

                          <td>

                              <span style="font-family: Calibri; font-size: 21pt"><img src="https://chart.googleapis.com/chart?chs=250x100&chd=t:60,40&cht=p3&chl=Hello|World"/></span>

                          </td>

                      </tr>

                  </table>';



$docx->replaceTemplateVariableByHTML('TABLE_2', 'block', $table, array('isFile' => false, 'parseDivsAsPs' => false, 'downloadImages' => true));



 



This link https://chart.googleapis.com/chart?chs=250x100&chd=t:60,40&cht=p3&chl=Hello|World will provide pie chart image but it is not work when we use to convert it to doc file.



Any solution? Thank in advance.


Posted by jorgelj  · 24-02-2014 - 09:06

Hello,



Google Charts doesn't allow to include an image as SRC, only if added in a web browser. You'll need to use CURL to generate and download the image and then add it to the document.



Regards.


Posted by anzai408  · 24-02-2014 - 11:19

Thank