Forum


Replies: 1   Views: 3993
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">
<head>
<meta charset="utf-8" />
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" >
<title>Test</title>
<style type="text/css">
#tbl-Details
{
    width:350px;
    font-size:13px;
    border-collapse:collapse
}
</style>
</head>
<body>
<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>
    <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>
        </table>
    </div>
</div>
</body>
</html>

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 :

<?php
require_once 'phpdocx-trial-pro-5.5/classes/CreateDocx.inc';
$docx = new CreateDocx();
$html='http://domain.com/path/to/file/test.html';
$docx->embedHTML($html, array('isFile' => true, 'downloadImages' => true));
$docx->addBackgroundImage('../test.jpg');
$docx->createDocx('test');
?>

Is there any way to:

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

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