Replies: 1   Views: 4025
Non repetitive background image not showing and css's position:absolute text not followed
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 anjanesh  · 18-02-2016 - 06:19

I have a simple HTML page like this :

<!DOCTYPE html>
<html lang="en" dir="ltr">
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<style type="text/css">
<div id="container" style="position:relative;width:608px;height:786px;background-image:url('../test.jpg')">
    <div style="position:absolute;top:100px;left:50px">
        <div style="">[Company Name]</div>
        <div style="text-transform:uppercase;font-size:30px">Business Plan</div>
        <div>[Current Month], [Year]</div>
    <div style="position:absolute;top:700px;left:25px">
        <table id="tbl-Details">
            <tr><td>[Name]</td><td>[City, State, Zip]</td></tr>
            <tr><td>[Title]</td><td>Tel : []</td></tr>
            <tr><td>[Company Name]</td><td>Fax : []</td></tr>
            <tr><td>[Street Address]</td><td>Email : []</td></tr>

But the resultant DOCX file doesn't contain the image and it doesnt show the text as per the CSS's position values. This is my PHP file :

require_once 'phpdocx-trial-pro-5.5/classes/';
$docx = new CreateDocx();
$docx->embedHTML($html, array('isFile' => true, 'downloadImages' => true));

Is there any way to:

1. Add a single non-repetitive image in the backgruond ?

2. Show text based on CSS's position values ?