PHPOffice is an open-source collection of libraries used for reading and writing files in formats compatible with various "office" suites, such as Microsoft Office and OpenOffice.
Questions tagged [phpoffice]
242 questions
2
votes
4 answers
Use PHP to get xls(Excel files) PHPOffice PHPExcel
Hy guys.
Thank you for your help. The answers in this forum are great!
In my site, i want to see the content from a xls Excel Spreadsheet.
After long searching i found this Project:
https://github.com/PHPOffice/PHPExcel/
I get the classes and tried…

Newbie
- 57
- 1
- 7
2
votes
1 answer
Adding Data Table element to the chart using PhpOffice
I'm trying to make a chart through PhpOffice and got some difficulties with adding the Data table element above the chart. I already can add Legend, but it seems that Data Table can be added…

Just_lbee
- 166
- 1
- 5
2
votes
1 answer
PHPOffice write a new file fatal errors
I am using this library to create .xlsx files from my PHP script.
Following this guide, I've tried exporting some data to a file called hello.xlsx.
However, this errors with the below messages:
Warning: ZipArchive::close(): Failure to create…

treyBake
- 6,440
- 6
- 26
- 57
2
votes
1 answer
PHPWord Footer Position
Does anyone know if it is possible to re-position (or set the height of) a footer using PHPWord?
I have a footer exactly as required in terms of text.
$footer = $section->addFooter();
$textrun = $footer->addTextRun();
$textrun->addText('My Footer…

JamesG
- 163
- 1
- 12
2
votes
0 answers
Encoding HTML entities in PHPWord
I've got a database full of content that has (I think) been cut and paste from Word into TinyMCE. I now need to use PHPWord (latest version) to turn these records back into Word documents.
The data is full of html hex character codes like “…

Sodium
- 31
- 4
2
votes
2 answers
Read MS word document with PHP Word
I have installed and set up PHP Word on PHPStorm (IDE). I am trying to read the line "learn from yesterday, live for today, hope for tomorrow..." from the word document below titled 'helloWorld.docx' using PHPWord.
This is my code to load and read…

wade king
- 353
- 4
- 14
2
votes
0 answers
Memory saving PhpOffice\PhpSpreadsheet
I would like to read a big (40 000 rows) xlsx file.
In the old version (PHPExcel) I used caching, and it worked fine.
Now I would like to migrate to the newest PhpSpreadsheet version, and I need to use caching.
Without cache settings the program…

Ekhrikhor
- 91
- 2
- 5
2
votes
0 answers
PHPSPREADSHEET : show hidden data row in chart on Excel
i have my exported excel using phpspreadsheet contain chart works good on libre office, but have blank area chart when i open using MS. Excel.
The problem is, data range i use to build chart is hidden using this…

Ryan Arief
- 983
- 2
- 16
- 36
2
votes
0 answers
Binding type string in a specific column with phpspreadsheet
this phpspreadsheet is really good but really documentationless.
So, I read a lot and was trying to define my personal valueBinder, and I think that is correct but is not executed i suppose.
First thing first i create my binder like this :
class…

gi4nni
- 31
- 3
2
votes
1 answer
Merge cols or rows in PhpOffice\PhpWord\TemplateProcessor
Is it possible to merge cols or rows in templateprocessor?
Thank you

Andhika Kurnia Aufa Azham
- 243
- 1
- 3
- 13
2
votes
4 answers
PHPWord background color of text box
I'm trying to set the background color of a text both either to a color, or to 100% transparent (whatever is easiest) but I'm struggling to achieve either.
I've tried "bgColor" as per some other elements but no luck :(
$textbox =…

AdrianGW
- 143
- 1
- 8
2
votes
1 answer
how to get content from Doc file in php
how to get content from Doc file in php
i use PHPOffice/PHPWord in Yii2.
this Code Dont work: (my Doc File is UTF8)
$phpWord = \PhpOffice\PhpWord\IOFactory::load($filename, 'MsDoc');
$sections = $phpWord->getSections();
foreach ($sections as $key =>…

user3770797
- 374
- 5
- 24
2
votes
2 answers
Yii2: phpoffice/phpexcel identifies .xlsx file as HTML
I am trying to use phpoffice/phpexcel plugin for my yii2 project to read excel files. For files with xls extension, the plugin works perfectly and I am able to read the contents but when I try using files with japanese filenames and xlsx extension,…

user1597438
- 2,171
- 5
- 35
- 78
2
votes
0 answers
How do I set PHPExcel line height to auto and wrap the text?
When I generate an excel file with large Strings, those won't auto-break and the row height won't be changed as well.
How do I enable auto-breaks and auto-heights in PHPExcel when using a fixed column width?
Trying this, just changed the height of…

SparklingWater
- 358
- 4
- 15
2
votes
1 answer
PhpWord: How to create a new paragraph with border and background color?
I am trying to create a neat Word document using the PhpWord library. Unfortunately, the documentation seems to be incomplete. I'd like to have paragraphs with a border and a background color, spanning the whole page width. I did some research and…

user3205494
- 297
- 4
- 10