This project is read-only.

Way to specify location of a table?

Apr 26, 2013 at 1:29 AM
Is there a way to move a table to a particular location on the page? I tried the following:

$styleTable = array('borderSize'=>6, 'left'=>3000, 'top'=>3000, 'borderColor'=>'006699', 'cellMargin'=>80);

It didn't change anything. I'm trying to place text at a specific location on the page, like writing to pdf docs allows you to do. I was planning on using a 1 cell table if it worked.

What I'd really like is a TextBox field. If it's not available and someone could give me some ideas on where to start, I could maybe hack one in if it's not too complex. The one complexity seems to be in the fact that it needs to be embedded in a drawing area, so you'd need a drawing area object as well.

Thanks.
Apr 29, 2013 at 10:33 PM
I tested a bit of positioning code. This is for a hard coded position, but it's easy enough to make the positions variables. It's inside _writeTable inside Base.php.
2419 and 1239 are 1.68 inches and .86 inches, so the multiplier at least in my doc seems to be about 1440 to convert from inches. I still want to add a TextBox field.
                if(!empty($tblStyle)) {
                    $objWriter->startElement('w:tblPr');
                        $objWriter->startElement('w:tblStyle');
                            $objWriter->writeAttribute('w:val', $tblStyle);
                        $objWriter->endElement();

                        $objWriter->startElement('w:tblpPr');
                        $objWriter->writeAttribute("w:leftFromText","180");
                        $objWriter->writeAttribute("w:rightFromText","180");
                        $objWriter->writeAttribute("w:vertAnchor","page");
                        $objWriter->writeAttribute("w:horzAnchor","page");
                        $objWriter->writeAttribute("w:tblpX","2419");
                        $objWriter->writeAttribute("w:tblpY","1239");
                        $objWriter->endElement();

                    $objWriter->endElement();
                }