aspose/cells 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

aspose/cells

最新稳定版本:25.10

Composer 安装命令:

composer require aspose/cells

包简介

A powerful library for manipulating and converting Excel (XLS, XLSX, XLSB), ODS, CSV and HTML files.

README 文档

README

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®.

PHP Excel Library Features

  • Convert spreadsheets to different formats including PDF, XPS, images & other Excel file formats.
  • Generate Excel files via API or using templates.
  • Create Pivot Tables, charts, sparklines & conditional formatting rules on-the-fly.
  • Refresh existing charts & convert charts to images or PDF.
  • Create & manipulate comments & hyperlinks.
  • Set complex formulas & calculate results via API.
  • Set protection on workbooks, worksheets, cells, columns or rows.
  • Create & manipulate named ranges.
  • Populate worksheets through Smart Markers.

Read & Write Excel Files

Microsoft Excel: XLS, XLSX, XLSB, XLTX, XLTM, XLSM, XML OpenOffice: ODS Text: CSV, Tab-Delimited, TXT, JSON Web: HTML, MHTML

Save Excel Files As

Fixed Layout: PDF, XPS Images: JPEG, PNG, BMP, SVG, TIFF, GIF, EMF Text: CSV, Tab-Delimited, JSON, SQL, XML

Getting Started with Aspose.Cells for PHP via Java

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.

Prerequisites

  1. JDK
  2. PHP/Java Bridge
  3. Web Server like Tomcat
  4. PHP

Installation

  1. Install Tomcat on any location such as \java\apache-tomcat-9.0.24.
  2. Copy JavaBridge.war to webapps folder of Tomcat such as \java\apache-tomcat-9.0.24\webapps.
  3. Copy aspose-cells-xx.x.jar, bcpkix-jdk15on-xxx.jar and bcprov-jdk15on-xxx.jar to lib folder such as \java\apache-tomcat-9.0.24\lib.
  4. Run \bin\startup.bat, JavaBridge.war will be deployed to \java\apache-tomcat-9.0.24\webapps\JavaBridge.
  5. Test http://localhost:8080/JavaBridge/test.php to ensure that PHP works fine.
  6. Copy aspose.cells.php and example.php to \java\apache-tomcat-9.0.24\webapps\JavaBridge.
  7. Open http://localhost:8080/JavaBridge/example.php or create your own PHP file as follows.

You will find the Jar and PHP library in vendor/aspose/cells folder.

Create Excel XLSX File from Scratch using PHP

<?php
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
require_once("aspose.cells.php");
 
use aspose\cells;
use aspose\cells\Workbook;
use aspose\cells\CellsHelper;
use aspose\cells\Color;
 
$workbook = new Workbook();
$workbook->getWorksheets()->get("Sheet1")->getCells()->get("A1")->putValue("testing...");
$workbook->save("result.xlsx");
 
echo aspose\cells\BorderType::BOTTOM_BORDER;
echo "\n";
 
echo "CellsHelper version: ".CellsHelper::getVersion();
echo "\n";
?>

Convert Excel XLSX File to PDF using PHP

<?php
require_once("http://localhost:8080/JavaBridge/java/Java.inc");
require_once("aspose.cells.php");
 
use aspose\cells;
use aspose\cells\Workbook;
use aspose\cells\PdfSaveOptions;
 
$workbook = new Workbook("example.xlsx");
$saveOptions = new PdfSaveOptions();
$saveOptions->setOnePagePerSheet(true);
$workbook->save("example.pdf", $saveOptions);
?>

Product Page | Documentation | API Reference | Code Examples | Blog | Free Support | Temporary License

统计信息

  • 总下载量: 2.45k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 2
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: proprietary
  • 更新时间: 2020-04-02