Download the PHP package burhan15/office-pack without Composer
On this page you can find all versions of the php package burhan15/office-pack. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package office-pack
Universal Office Document SDK
A first-party Office library for PHP and Node.js. Install it into your app and create spreadsheets, Word documents, PowerPoint decks, and PDFs with one API.
The files are standard OOXML (.xlsx, .docx, .pptx) and PDF, so they open in Microsoft Office, Google Sheets, Google Docs, Google Slides, and LibreOffice. This package does not wrap PhpSpreadsheet, ExcelJS, SheetJS, PHPWord, LibreOffice, or OnlyOffice.
Requirements
| Runtime | Version |
|---|---|
| PHP | 8.1+, ext-zip, ext-dom, ext-openssl |
| Node.js | 18+ (ESM) |
Install
Spreadsheet
Calling sheet('Sales') on a new workbook names the first sheet Sales. It does not leave an empty Sheet1 behind.
Formulas
Formulas use Excel-style English (=SUM(A1:A3)). PHP and Node return the same results for:
SUM AVERAGE COUNT COUNTA MIN MAX IF IFS AND OR NOT ROUND ROUNDUP ROUNDDOWN ABS CEILING FLOOR MOD POWER SQRT CONCAT CONCATENATE LEFT RIGHT MID LEN LOWER UPPER TRIM DATE DAY MONTH YEAR TODAY NOW VLOOKUP HLOOKUP XLOOKUP INDEX MATCH SUMIF SUMIFS COUNTIF COUNTIFS AVERAGEIF AVERAGEIFS
Arithmetic (+ - * / ^) and comparisons (= <> < > <= >=) work too. Any other function evaluates to #NAME?.
VLOOKUP and HLOOKUP take a range and a FALSE argument for an exact match:
Spreadsheet API
| Action | PHP | Node |
|---|---|---|
| Create | Office::excel()->create() |
Office.excel().create() |
| Open | Office::excel()->open($path) |
await Office.excel().open(path) |
| Sheet | $wb->sheet('Sales') |
wb.sheet('Sales') |
| Value | $sheet->setCell('A1', 'Hi') |
sheet.setCell('A1', 'Hi') |
| Formula | $sheet->setFormula('B1', '=A1*2') |
sheet.setFormula('B1', '=A1*2') |
| Many rows | $sheet->fromRows($rows) |
sheet.fromRows(rows) |
| Skip calc on save | $wb->calculateOnSave = false |
Office.excel({ calculateOnSave: false }) |
| Recalculate | $wb->calculate() |
wb.calculate() |
| Save | $wb->save('out.xlsx') |
await wb.save('out.xlsx') |
| HTTP bytes | echo $wb->toString() |
wb.toBuffer() |
| CSV text | Office::csvFromRows($rows) |
Office.csvFromRows(rows) |
| Large file | — | await wb.streamToFile(path) |
withPassword() stores an SDK envelope (AES-256-GCM). PHP and Node can open that file with the same password. Excel’s own password format is not supported.
Word
PowerPoint
In PHP, the first addText() on a slide is the title.
enableTaggedPdf() writes a page tree with MarkInfo and a language tag. Merge, split, and text redaction are on the PDF object. This is not a veraPDF-certified PDF/UA suite.
HTTP download
Verify
From a clone of this repository:
CLI, after npm install @burhan15/office-pack:
Documentation
| Topic | Doc |
|---|---|
| Integrator guide | docs/guides/integration.md |
| Excel and Google compatibility | docs/guides/ms-google-compatibility.md |
| Feature matrix | docs/research/feature-matrix.md |
| Architecture | docs/architecture/system-architecture.md |
| Security | SECURITY.md |
License
Apache-2.0. See LICENSE.
All versions of office-pack with dependencies
ext-zip Version *
ext-dom Version *
ext-openssl Version *