Ü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-viewer-cloud

Packagist Version Packagist Downloads PHP-GroupDocsCloud


Gereksinimler

  • PHP 8.1 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.Viewer 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.Viewer 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\Viewer\Configuration();
$configuration->setAppSid("YourClientId");
$configuration->setAppKey("YourClientSecret");
$configuration->setApiBaseUrl("https://api.groupdocs.cloud");

$viewApi = new GroupDocs\Viewer\ViewApi($configuration);

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

Bir belgeyi dönüştürün ve indirin (doğrudan, bulut depolama yok)

Başlatıldıktan sonra, yerel bir belgeyi JPG’ye dönüştürmek ve sonucu doğrudan almak için bu temel örneği kullanın.

<?php

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

use GroupDocs\Viewer\Model\Requests;

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

$viewApi = new GroupDocs\Viewer\ViewApi($configuration);

$format = "jpg";
$filePath = __DIR__ . "/sample.docx";
$request = new Requests\convertAndDownloadRequest($format, $filePath);

$result = $viewApi->convertAndDownload($request);

echo "Document converted: " . $result->getSize() . "\n";

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

Belgeyi Duyarlı HTML ile Oluşturun

Bu örnek, bulut depolama alanındaki bir Word belgesini duyarlı HTML olarak oluşturur.

<?php

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

use GroupDocs\Viewer\Model;
use GroupDocs\Viewer\Model\Requests;

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

$viewApi = new GroupDocs\Viewer\ViewApi($configuration);

$viewOptions = new Model\ViewOptions();

$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("SampleFiles/sample.docx");
$viewOptions->setFileInfo($fileInfo);
$viewOptions->setViewFormat(Model\ViewOptions::VIEW_FORMAT_HTML);

$renderOptions = new Model\HtmlOptions();
$renderOptions->setIsResponsive(true);
$viewOptions->setRenderOptions($renderOptions);

$request = new Requests\createViewRequest($viewOptions);
$response = $viewApi->createView($request);

echo "Responsive HTML rendered: " . count($response->getPages()) . "\n";

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

Seçilen Sayfaları Oluştur

Bu örnek yalnızca 1 ve 3. sayfaları oluşturur.

<?php

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

use GroupDocs\Viewer\Model;
use GroupDocs\Viewer\Model\Requests;

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

$viewApi = new GroupDocs\Viewer\ViewApi($configuration);

$viewOptions = new Model\ViewOptions();

$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("SampleFiles/sample.docx");
$viewOptions->setFileInfo($fileInfo);
$viewOptions->setViewFormat(Model\ViewOptions::VIEW_FORMAT_HTML);

$renderOptions = new Model\HtmlOptions();
$renderOptions->setPagesToRender([1, 3]);
$viewOptions->setRenderOptions($renderOptions);

$request = new Requests\createViewRequest($viewOptions);
$response = $viewApi->createView($request);

echo "Selected pages rendered: " . count($response->getPages()) . "\n";

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

Desteklenen Dosya Formatlarını Alın

Desteklenen dosya formatlarını alın.

<?php

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

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

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

$response = $infoApi->getSupportedFileFormats();

echo "Number of formats = " . count($response->getFormats()) . "\n";

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

GitHub’daki Örnekler

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

CategoryExamples
Temel KullanımDesteklenen formatlar, belge bilgileri, ekler, dönüştürme ve indirme
HTML GörüntüleyiciDuyarlı düzen, HTML’yi küçültün, yazı tiplerini hariç tutun, resim boyutunu sınırlayın, yazdırma için optimize edin
Resim GörüntüleyiciResim boyutunu, JPG kalitesini, metin kaplamasını, metin koordinatlarını ayarlayın
PDF GörüntüleyiciPDF’yi koruyun, JPG kalitesini ayarlayın
Ortak Oluşturma SeçenekleriFiligranlar, sayfaları ters çevirin ve döndürün, yorumlar, ardışık sayfalar, gizli sayfalar, notlar, seçilen sayfalar, özel yazı tipleri, sayfaları yeniden sıralayın, eksik yazı tipini değiştirin
Yükleme SeçenekleriKorumalı belgeler, kodlamayı belirtin
Dosya Türüne Göre OluşturmaArşiv, CAD, e-posta, Lotus Notes, MS Project, Outlook, PDF, elektronik tablo, metin, Visio, Word

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

  1. örnek deposunu kopyalayın veya indirin
  2. Examples/Utils.php‘i düzenleyin ve Client Id ile Client Secret ayarlarınızı yapın
  3. Examples dizinine gidin
  4. composer update‘ı ç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 Rendering API | PHP Cloud API | GroupDocs.Viewer Cloud | REST API | HTML Rendering | PDF Conversion | Image Rendering | Document Viewing | Multi-Page Rendering | Document Streaming | CAD Rendering | E-Mail Message Rendering | Visio Rendering | MS Project Rendering | Outlook Data Rendering | Spreadsheet Rendering | Word Processing Rendering | Custom View Options | Responsive HTML | Attachment Rendering | Secure API Access | Cloud Storage Integration



 Türkçe