|
1 | 1 | # PHP Library for Excel File Formats |
2 | 2 |
|
3 | | -[Aspose.Cells for PHP via Java](https://products.aspose.com/cells/php-java) is a feature-rich API to create, process, manipulate & convert Excel & OpenOffice spreadsheets using PHP. API offers Excel file generation, conversion, worksheets styling, Pivot Table & chart management & rendering, reliable formula calculation engine and much more - all without any dependency on Office Automation or Microsoft Excel®. |
4 | | - |
5 | | -<p align="center"> |
6 | | - <a title="Download ZIP" href="https://github.com/aspose-cells/Aspose.Cells-for-PHP-via-Java/archive/master.zip"> |
7 | | - <img src="https://raw.githubusercontent.com/AsposeExamples/java-examples-dashboard/master/images/downloadZip-Button-Large.png" alt="Download Aspose.Cells for PHP via Java Examples, Plugins and Showcases" /> |
8 | | - </a> |
9 | | -</p> |
| 3 | +Aspose.Cells for PHP via Java is a feature-rich API to create, process, manipulate & convert Excel & OpenOffice spreadsheets using PHP. API offers Excel file generation, conversion, worksheets styling, Pivot Table & chart management & rendering, reliable formula calculation engine and much more - all without any dependency on Office Automation or Microsoft Excel®. |
10 | 4 |
|
11 | 5 | ## PHP Excel Library Features |
12 | 6 |
|
13 | | -### File Formats and Conversions |
14 | | - |
15 | | -- High quality conversions from Excel to other supported formats. |
16 | | -- Convert any Spreadsheet to PDF with high fidelity. |
17 | | -- Load and save documents in the tab delimited file format. |
18 | | -- Easily extract worksheet text by saving in plain text format. |
19 | | - |
20 | | -### Rendering |
21 | | - |
22 | | -- Render Excel worksheet pages to raster images & spreadsheet pages to vector images. |
23 | | -- Specify image resolution, quality, compression and other options. |
24 | | - |
25 | | -### Spreadsheet Content Features |
26 | | - |
27 | | -- Copy an existing worksheet along with included images, charts & other objects. |
28 | | -- Implement data sorting, data validations and smart markers. |
29 | | -- Preserve or remove addin, VBA, macros. |
30 | | -- Add, preserve or extract OLE objects from the spreadsheets. |
31 | | -- Apply file encryption. |
32 | | - |
33 | | -### Spreadsheet Formatting Features |
34 | | - |
35 | | -- Apply formatting (fonts, colors, effects, border etc.) to chracters in the cells. |
36 | | -- Apply format settings on a worksheet, row, column as well as a range of cells. |
37 | | - |
38 | | -### Page Setup Features |
39 | | - |
40 | | -- Configure page orientation, scaling as well as paper size. |
41 | | -- Specify page margins and page centering. |
| 7 | +- Convert spreadsheets to different formats including PDF, XPS, images & other Excel file formats. |
| 8 | +- Generate Excel files via API or using templates. |
| 9 | +- Create Pivot Tables, charts, sparklines & conditional formatting rules on-the-fly. |
| 10 | +- Refresh existing charts & convert charts to images or PDF. |
| 11 | +- Create & manipulate comments & hyperlinks. |
| 12 | +- Set complex formulas & calculate results via API. |
| 13 | +- Set protection on workbooks, worksheets, cells, columns or rows. |
| 14 | +- Create & manipulate named ranges. |
| 15 | +- Populate worksheets through Smart Markers. |
42 | 16 |
|
43 | 17 | ## Read & Write Excel Files |
44 | 18 |
|
45 | | -**Microsoft Excel:** XLS, XLSX, XLSB, XLTX, XLTM, XLSM, XML\ |
46 | | -**OpenOffice:** ODS\ |
47 | | -**Text:** CSV, Tab-Delimited, TXT\ |
| 19 | +**Microsoft Excel:** XLS, XLSX, XLSB, XLTX, XLTM, XLSM, XML |
| 20 | +**OpenOffice:** ODS |
| 21 | +**Text:** CSV, Tab-Delimited, TXT |
48 | 22 | **Web:** HTML, MHTML |
49 | 23 |
|
50 | 24 | ## Save Excel Files As |
51 | 25 |
|
52 | | -**Fixed Layout:** PDF, XPS\ |
| 26 | +**Fixed Layout:** PDF, XPS |
53 | 27 | **Images:** JPEG, PNG, BMP, SVG, TIFF, GIF, EMF |
54 | 28 |
|
55 | | -## System Requirements |
| 29 | +## Getting Started with Aspose.Cells for PHP via Java |
56 | 30 |
|
57 | | -Aspose.Cells for PHP via Java is platform independent API and can be used on any platform (Windows, Linux, MacOS etc.) where [PHP](http://www.php.net/downloads.php) 7 or greater versions is installed. The machine must have Oracle JDK 7 or greater versions before setting up the installation. |
| 31 | +Aspose.Cells for PHP via Java consists of 2 individual parts, the script wrapper (aspose.cells.php) and Aspose.Cells for Java. These components communicate via PHP/Java Bridge whereas both require separate environments & processes for execution. |
58 | 32 |
|
59 | | -## Get Started with Aspose.Cells for PHP via Java |
| 33 | +### Prerequisites |
| 34 | +1. JDK |
| 35 | +2. PHP/Java Bridge |
| 36 | +3. Web Server like Tomcat |
| 37 | +4. PHP |
60 | 38 |
|
61 | | -Aspose.Cells for PHP via Java consists of two individual parts, the script wrapper (aspose.cells.php) and Aspose.Cells for Java. These components communicate via PHP/Java Bridge whereas both require separate environments & processes for execution. For the detailed instructions please visit [Installation and Usage](https://docs.aspose.com/cells/java/setup-and-installation-guidelines/) documentation page. |
| 39 | +### Installation |
62 | 40 |
|
63 | | -## Create a New XLSX File and Insert Data using Java |
| 41 | +1. Install Tomcat on any location such as `\java\apache-tomcat-9.0.24`. |
| 42 | +2. Copy JavaBridge.war to `webapps` folder of Tomcat such as `\java\apache-tomcat-9.0.24\webapps`. |
| 43 | +3. Copy aspose-cells-xx.x.jar and bcprov-jdk15on-xxx.jar to `lib` folder such as `\java\apache-tomcat-9.0.24\lib`. |
| 44 | +4. Run `\bin\startup.bat`, JavaBridge.war will be deployed to `\java\apache-tomcat-9.0.24\webapps\JavaBridge`. |
| 45 | +5. Test http://localhost:8080/JavaBridge/test.php to ensure that PHP works fine. |
| 46 | +6. Copy aspose.cells.php and example.php to `\java\apache-tomcat-9.0.24\webapps\JavaBridge`. |
| 47 | +7. Open http://localhost:8080/JavaBridge/example.php or create your own PHP file as follows. |
| 48 | + |
| 49 | +You will find the Jar and PHP library in `vendor/aspose/cells` folder. |
| 50 | + |
| 51 | +### Create Excel XLSX File from Scratch using PHP |
64 | 52 |
|
65 | 53 | ```php |
66 | 54 | <?php |
67 | 55 | require_once("http://localhost:8080/JavaBridge/java/Java.inc"); |
68 | 56 | require_once("aspose.cells.php"); |
69 | | - |
| 57 | + |
70 | 58 | use aspose\cells; |
71 | 59 | use aspose\cells\Workbook; |
72 | 60 | use aspose\cells\CellsHelper; |
73 | 61 | use aspose\cells\Color; |
74 | | - |
| 62 | + |
75 | 63 | $workbook = new Workbook(); |
76 | 64 | $workbook->getWorksheets()->get("Sheet1")->getCells()->get("A1")->putValue("testing..."); |
77 | 65 | $workbook->save("result.xlsx"); |
78 | | - |
| 66 | + |
79 | 67 | echo aspose\cells\BorderType::BOTTOM_BORDER; |
80 | 68 | echo "\n"; |
81 | | - |
| 69 | + |
82 | 70 | echo "CellsHelper version: ".CellsHelper::getVersion(); |
83 | 71 | echo "\n"; |
84 | 72 | ?> |
85 | 73 | ``` |
86 | 74 |
|
87 | | -[Home](https://www.aspose.com/) | [Product Page](https://products.aspose.com/cells/php-java) | [Docs](https://docs.aspose.com/cells/phpjava/) | [API Reference](https://apireference.aspose.com/cells/php) | [Examples](https://github.com/aspose-cells/Aspose.Cells-for-PHP-via-Java) | [Blog](https://blog.aspose.com/category/cells/) | [Free Support](https://forum.aspose.com/c/cells) | [Temporary License](https://purchase.aspose.com/temporary-license) |
| 75 | +### Convert Excel XLSX File to PDF using PHP |
| 76 | + |
| 77 | +```php |
| 78 | +<?php |
| 79 | +require_once("http://localhost:8080/JavaBridge/java/Java.inc"); |
| 80 | +require_once("aspose.cells.php"); |
| 81 | + |
| 82 | +use aspose\cells; |
| 83 | +use aspose\cells\Workbook; |
| 84 | +use aspose\cells\PdfSaveOptions; |
| 85 | + |
| 86 | +$workbook = new Workbook("example.xlsx"); |
| 87 | +$saveOptions = new PdfSaveOptions(); |
| 88 | +$saveOptions->setOnePagePerSheet(true); |
| 89 | +$workbook->save("example.pdf", $saveOptions); |
| 90 | +?> |
| 91 | +``` |
| 92 | + |
| 93 | +[Product Page](https://products.aspose.com/cells/php-java) | [Documentation](https://docs.aspose.com/cells/phpjava/) | [API Reference](https://apireference.aspose.com/cells/php) | [Code Examples](https://github.com/aspose-cells/Aspose.Cells-for-Java) | [Blog](https://blog.aspose.com/category/cells/) | [Free Support](https://forum.aspose.com/c/cells) | [Temporary License](https://purchase.aspose.com/temporary-license) |
0 commit comments