Questions tagged [phpoffice]

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.

242 questions
0
votes
3 answers

Class 'PhpOffice\PhpWord\TemplateProcessor' not found

I have PHPWORD in /libraries/PhpOffice/PhpWord/ directory. I'm trying to use it in completly other part of app (Joomla website) like this: require_once JPATH_LIBRARIES.'/vendor/autoload.php'; //composer require_once…
Barto
  • 469
  • 1
  • 6
  • 15
0
votes
2 answers

PHPWord /samples/ files

I am trying to download the PHPOffice/PHPWord GitHub repository from : https://github.com/PHPOffice/PHPWord/tree/master In the downloaded zip archive I only get the /src/ directory. How do I download the other directories? I need the samples/…
0
votes
2 answers

How to apply footer on last page only using phpspreadsheet

Is spreadsheet has function to set footer on last page only? If could not, how to create report footer in phpspreadsheet? Is this possible? $spreadsheet->getActiveSheet()->getHeaderFooter()->setOddFooter('footer caption'); Thanks in advance.
Premlatha
  • 1,676
  • 2
  • 20
  • 40
0
votes
2 answers

How to lock particular cell using phpspreadsheet

Initially all cells in worksheet are locked. Then, I unlock all the cells and try to lock only some of the cells. $spreadsheet->getActiveSheet()->getStyle('A1')->getLocked()->applyFromArray( [ 'locked' => TRUE, 'hidden' =>…
Premlatha
  • 1,676
  • 2
  • 20
  • 40
0
votes
1 answer

Excel to php remove tabulations and unused chars

I use phpOffice library to read data from an Excel file and convert it to a php array, here his the code providing the php array from excel file data: $spreadsheet= \PhpOffice\PhpSpreadsheet\IOFactory::load('/User/myMac/exampl.xls'); $data =…
MiharbKH
  • 206
  • 2
  • 9
0
votes
1 answer

How to detect a EOF (End Of File) character when read word file with PHPWord library

Im read word file with PHPWord libary $objReader = \PhpOffice\PhpWord\IOFactory::createReader('Word2007'); $phpWord = $objReader->load($_FILES["fileToUpload"]['tmp_name'], "UTF-8"); foreach ($phpWord->getSections() as $section) { $arrays =…
0
votes
0 answers

PHPspreadsheet only saves "Sheet1" when xlsx but is ok when xls

I'm using PHPSpreadsheet to generate an XLSX file. the code $spreadsheet->setActiveSheetIndex(0); $writer = new Xlsx($spreadsheet); $full_filename = $path . $filename . '.xlsx'; $writer->save($full_filename); When using the above code file only…
milwell
  • 1
  • 3
0
votes
2 answers

PHPSpreadsheet undefined function mb_strlen

I got phpspreadsheet installed but am getting an error: PHP Fatal error: Call to undefined function PhpOffice\PhpSpreadsheet\Shared\mb_strlen() in…
Jason M
  • 145
  • 1
  • 2
  • 10
0
votes
1 answer

Cannot find archive file. in PHPWord-0.16.0/vendor/phpoffice/common/src/Common/XMLReader.php

I want to convert docx file to html in php and send the contents as json response to angular side. I'm trying this code from here require_once 'bootstrap.php'; $phpWord = new \PhpOffice\PhpWord\PhpWord(); $objReader =…
pooja
  • 45
  • 8
0
votes
1 answer

How to adjust style of table cell border?

When I add a cell to a table, I can manipulate its thickness (borderBottomSize), its color (borderBottomColor) but not its style (dashed, dotted, longdashed, ...). When I read the code, the PhpOffice\PhpWord\Style\Cell extends the…
0
votes
1 answer

PHPOffice - PowerPoint : How do I draw a dashed line in my PowerPoint slide?

I want to generate a dashed line in my PowerPoint presentation using PHPOffice but I can only generate solid or double lines. Line Generator Code $shape->getBorder() ->setColor($color) ->setLineStyle(Border::LINE_SOLID); How do I…
Vahe
  • 1,699
  • 3
  • 25
  • 76
0
votes
2 answers

phpspreadsheet use of the MD5 hashing

This question is for the developers of phpexcel/phpspreadsheet. We are currently using the library on our website to generate excel files (obviously) and are currently in the process of getting SOC2 certified; which requires us to run all our code…
iGuy
  • 42
  • 3
0
votes
1 answer

Ppt to image by using php with pure php code (PHPOffice/PHPPresentation)

I want to make image from ppt/pptx. I can read ppt by using PHPOffice/PHPPresentation, but I can't convert it into images. require_once 'src/PhpPresentation/Autoloader.php'; \PhpOffice\PhpPresentation\Autoloader::register(); require_once…
0
votes
1 answer

PhpOffice/PhpSpreadsheet "Class PhpOffice\PhpSpreadsheet\IOFactory could not be loaded"

I'm at my wit's end. I installed PhpOffice using composer on my local dev machine and it works fine. I uploaded my app code to a remote test server, then installed PhpOffice using composer on that server. On both my local machine and the remote…
0
votes
1 answer

Package installation error in Yii2 framework?

I have a requirement to use PHPOffice/PhpSpreadsheet, to install PhpSpreadsheet I followed this link. So I installed PhpSpreadsheet into my project using 'composer' by running the command composer require phpoffice/phpspreadsheet at command…
Prasad Patel
  • 707
  • 3
  • 16
  • 53