Ürünlerimize göz atın

If so you can download any of the below versions for testing. The product will function as normal except for an evaluation limitation. At the time of purchase we provide a license file via email that will allow the product to work in its full capacity. If you would also like an evaluation license to test without any restrictions for 30 days, please follow the directions provided here.


Product Docs Swagger Examples Blog Support Dashboard

Kurulum

Paket Packagist’te mevcut‘dir ve aşağıdaki komut çalıştırılarak Composer aracılığıyla kurulabilir:

composer require groupdocscloud/groupdocs-editor-cloud

Packagist Version Packagist Downloads PHP-GroupDocsCloud


Gereksinimler

  • PHP 8.2 veya üzeri
  • Composer
  • PHP uzantıları — curl, json, mbstring
  • GroupDocs Cloud kimlik bilgileri — Client ID and Client Secret Kontrol Panelinden

Bağımlılıklar

SDK aşağıdaki paketleri gerektirir:

PackageConstraint
guzzlehttp/guzzle^6.5.8 or ^7.4.5
ext-curl*
ext-json*
ext-mbstring*

Hızlı Başlangıç

API kimlik bilgilerinizi alın

GroupDocs.Editor Cloud’u kullanmak için, GroupDocs.Cloud Dashboard adresinden kaydolun ve Müşteri Kimliğinizi ve Müşteri Sırrınızı alın.

API’yi başlat

PHP için GroupDocs.Editor Cloud SDK’yı kullanmaya başlamak için aşağıdaki kodu kullanın:

<?php

require_once(__DIR__ . '/vendor/autoload.php');

// Get your ClientId and ClientSecret at https://dashboard.groupdocs.cloud
$configuration = new GroupDocs\Editor\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");

$editApi = new GroupDocs\Editor\EditApi($configuration);

Tam örneği CommonUtils.php dosyasında görün.

Bir Word belgesini düzenleyin

Başlatıldıktan sonra, parola korumalı bir Word belgesini yüklemek, HTML gösterimini düzenlemek ve sonucu kaydetmek için bu temel örneği kullanın.

<?php

require_once(__DIR__ . '/vendor/autoload.php');

use GroupDocs\Editor\Model;
use GroupDocs\Editor\Model\Requests;

$configuration = new GroupDocs\Editor\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");

$editApi = new GroupDocs\Editor\EditApi($configuration);
$fileApi = new GroupDocs\Editor\FileApi($configuration);

$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("WordProcessing/password-protected.docx");
$fileInfo->setPassword("password");

$loadOptions = new Model\WordProcessingLoadOptions();
$loadOptions->setFileInfo($fileInfo);
$loadOptions->setOutputPath("output");
$loadResult = $editApi->load(new Requests\loadRequest($loadOptions));

$htmlFile = $fileApi->downloadFile(new Requests\downloadFileRequest($loadResult->getHtmlPath()));
$html = file_get_contents($htmlFile->getRealPath());
$html = str_replace("Sample test text", "Hello world", $html);
file_put_contents($htmlFile->getRealPath(), $html);

$fileApi->uploadFile(new Requests\uploadFileRequest($loadResult->getHtmlPath(), $htmlFile->getRealPath()));

$saveOptions = new Model\WordProcessingSaveOptions();
$saveOptions->setFileInfo($fileInfo);
$saveOptions->setOutputPath("output/edited.docx");
$saveOptions->setHtmlPath($loadResult->getHtmlPath());
$saveOptions->setResourcesPath($loadResult->getResourcesPath());
$saveResult = $editApi->save(new Requests\saveRequest($saveOptions));

echo "Document edited: " . $saveResult->getPath() . "\n";

Tam örneği EditWordProcessingDocument.php dosyasında görün.

Bir Elektronik Tablo Belgesini Düzenleyin

Bu örnek, bir XLSX dosyasının ilk çalışma sayfasını yükler, HTML içeriğini düzenler ve elektronik tabloyu kaydeder.

<?php

require_once(__DIR__ . '/vendor/autoload.php');

use GroupDocs\Editor\Model;
use GroupDocs\Editor\Model\Requests;

$configuration = new GroupDocs\Editor\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");

$editApi = new GroupDocs\Editor\EditApi($configuration);
$fileApi = new GroupDocs\Editor\FileApi($configuration);

$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("Spreadsheet/four-sheets.xlsx");

$loadOptions = new Model\SpreadsheetLoadOptions();
$loadOptions->setFileInfo($fileInfo);
$loadOptions->setOutputPath("output");
$loadOptions->setWorksheetIndex(0);
$loadResult = $editApi->load(new Requests\loadRequest($loadOptions));

$htmlFile = $fileApi->downloadFile(new Requests\downloadFileRequest($loadResult->getHtmlPath()));
$html = file_get_contents($htmlFile->getRealPath());
$html = str_replace("This is sample sheet", "This is sample sheep", $html);
file_put_contents($htmlFile->getRealPath(), $html);

$fileApi->uploadFile(new Requests\uploadFileRequest($loadResult->getHtmlPath(), $htmlFile->getRealPath()));

$saveOptions = new Model\SpreadsheetSaveOptions();
$saveOptions->setFileInfo($fileInfo);
$saveOptions->setOutputPath("output/edited.xlsx");
$saveOptions->setHtmlPath($loadResult->getHtmlPath());
$saveOptions->setResourcesPath($loadResult->getResourcesPath());
$saveResult = $editApi->save(new Requests\saveRequest($saveOptions));

echo "Document edited: " . $saveResult->getPath() . "\n";

Tam örneği EditSpreadsheetDocument.php dosyasında görün.

Belge Bilgilerini Alın

Parola korumalı bir Word belgesi için sayfa sayısını alın.

<?php

require_once(__DIR__ . '/vendor/autoload.php');

use GroupDocs\Editor\Model;
use GroupDocs\Editor\Model\Requests;

$configuration = new GroupDocs\Editor\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");

$infoApi = new GroupDocs\Editor\InfoApi($configuration);

$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("WordProcessing/password-protected.docx");
$fileInfo->setPassword("password");

$response = $infoApi->getInfo(new Requests\getInfoRequest($fileInfo));

echo "Page Count = " . $response->getPageCount() . "\n";

Tam örneği GetDocumentInformation.php dosyasında görün.

Desteklenen Dosya Türlerini Alın

Desteklenen dosya formatlarını alın.

<?php

require_once(__DIR__ . '/vendor/autoload.php');

$configuration = new GroupDocs\Editor\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");

$infoApi = new GroupDocs\Editor\InfoApi($configuration);

$response = $infoApi->getSupportedFileFormats();

foreach ($response->getFormats() as $format) {
    echo $format->getFileFormat() . " - " . $format->getExtension() . "\n";
}

Tam örneği GetSupportedFileTypes.php dosyasında görün.

GitHub’daki Örnekler

GroupDocs.Editor Cloud PHP Examples deposu aşağıdakileri kapsayan çalıştırılmaya hazır örnekler içerir:

CategoryExamples
Dosya TürleriDesteklenen dosya türleri
Belge BilgileriBelge bilgileri, lisans tüketimi
Düzenleme İşlemleri — WordKelime işlem belgelerini, parola korumalı dosyalar dahil, düzenleyin
Düzenleme İşlemleri — Elektronik TabloÇalışma sayfası seçimiyle elektronik tablo belgelerini düzenleyin
Düzenleme İşlemleri — SunumSlayt seçimiyle sunum belgelerini düzenleyin
Düzenleme İşlemleri — DSVSınırlayıcıyla ayrılmış değer belgelerini düzenleyin
Düzenleme İşlemleri — MetinDüz metin belgelerini düzenleyin

Örnekler nasıl çalıştırılır

  1. örnek deposunu kopyalayın veya indirin
  2. Examples/CommonUtils.php‘i düzenleyin ve ClientId ile ClientSecret ayarlarınızı yapın
  3. Examples dizinine gidin
  4. composer update‘i çalıştırın
  5. php RunExamples.php komutunu çalıştırın

Daha fazla ayrıntı için Getting Started adresini ziyaret edin.


Product Docs Swagger Examples Blog Support Dashboard


Tags

Document Editing API | PHP Cloud API | GroupDocs.Editor Cloud | REST API | Word Processing Formats | Spreadsheet Formats | Presentation Formats | Text Formats | CSV Files | DOCX Documents | XLSX Documents | PPTX Presentations | Password-Protected Files | Cloud Storage Integration | Document Info Retrieval | File Operations | WYSIWYG Editing | Multi-Platform Support | Secure API Access | HTML Editing | Cross-platform API



 Türkçe