Blader door onze producten

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

Installation

Das Paket ist verfügbar bei Packagist und kann über Composer mit folgendem Befehl installiert werden:

composer require groupdocscloud/groupdocs-parser-cloud

Packagist Version Packagist Downloads PHP-GroupDocsCloud


Anforderungen

  • PHP 8.1 oder höher
  • Composer
  • PHP-Erweiterungen — curl, json, mbstring
  • GroupDocs Cloud-Anmeldeinformationen — Client ID and Client Secret vom Dashboard

Abhängigkeiten

Das SDK benötigt die folgenden Pakete:

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

Schnellstart

API-Anmeldeinformationen abrufen

Um GroupDocs.Parser Cloud zu verwenden, registrieren Sie sich im GroupDocs.Cloud Dashboard und holen Sie sich Ihre Client ID und Client Secret.

API initialisieren

Verwenden Sie den folgenden Code, um mit dem GroupDocs.Parser Cloud SDK für PHP zu beginnen:

<?php

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

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

$parseApi = new GroupDocs\Parser\ParseApi($configuration);

Siehe das vollständige Beispiel in Utils.php.

Text aus einem Dokument extrahieren

Nach der Initialisierung können Sie mit diesem grundlegenden Beispiel Text aus einem Dokument im Cloud-Speicher extrahieren.

<?php

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

use GroupDocs\Parser\Model;
use GroupDocs\Parser\Model\Requests;

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

$parseApi = new GroupDocs\Parser\ParseApi($configuration);

$options = new Model\TextOptions();

$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("email/eml/embedded-image-and-attachment.eml");
$options->setFileInfo($fileInfo);

$request = new Requests\textRequest($options);
$result = $parseApi->text($request);

echo "Text: " . $result->getText() . "\n";

Siehe das vollständige Beispiel in ExtractTextFromTheWholeDocument.php.

Unterstützte Dateiformate abrufen

Rufen Sie die unterstützten Dateiformate ab.

<?php

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

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

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

$result = $infoApi->getSupportedFileFormats();

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

Siehe das vollständige Beispiel in GetSupportedFileTypes.php.

Dokument nach Vorlage parsen

Dieses Beispiel parst ein Dokument mit einer im Cloud-Speicher gespeicherten Vorlage und liest Textfelder und Tabellenzellen.

<?php

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

use GroupDocs\Parser\Model;
use GroupDocs\Parser\Model\Requests;

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

$parseApi = new GroupDocs\Parser\ParseApi($configuration);

$options = new Model\ParseOptions();

$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("words-processing/docx/companies.docx");
$options->setFileInfo($fileInfo);
$options->setTemplatePath("templates/companies.json");

$request = new Requests\parseRequest($options);
$result = $parseApi->parse($request);

foreach ($result->getFieldsData() as $data) {
    if ($data->getPageArea()->getPageTextArea() != null) {
        echo "Field name: " . $data->getName() . ". Text: " . $data->getPageArea()->getPageTextArea()->getText() . "\n";
    }

    if ($data->getPageArea()->getPageTableArea() != null) {
        echo "Table name: " . $data->getName() . "\n";
        foreach ($data->getPageArea()->getPageTableArea()->getPageTableAreaCells() as $cell) {
            echo "Row " . $cell->getRowIndex() . " column " . $cell->getColumnIndex() . ": " . $cell->getPageArea()->getPageTextArea()->getText() . "\n";
        }
    }
}

Siehe das vollständige Beispiel in ParseByTemplateStoredInUserStorage.php.

Bilder aus einem Dokument extrahieren

Dieses Beispiel extrahiert eingebettete Bilder aus einer Präsentation und gibt jeden Speicherpfad und jede Download-URL aus.

<?php

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

use GroupDocs\Parser\Model;
use GroupDocs\Parser\Model\Requests;

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

$parseApi = new GroupDocs\Parser\ParseApi($configuration);

$options = new Model\ImagesOptions();

$fileInfo = new Model\FileInfo();
$fileInfo->setFilePath("slides/three-slides.pptx");
$options->setFileInfo($fileInfo);

$request = new Requests\imagesRequest($options);
$result = $parseApi->images($request);

foreach ($result->getImages() as $image) {
    echo "Image path: " . $image->getPath() . ". Download url: " . $image->getDownloadUrl() . "\n";
    echo "Format: " . $image->getFileFormat() . ". Page index: " . $image->getPageIndex() . "\n";
}

Siehe das vollständige Beispiel in ExtractImagesFromTheWholeDocument.php.

Beispiele auf GitHub

Das Repository GroupDocs.Parser Cloud PHP Examples enthält sofort ausführbare Beispiele für:

CategoryExamples
InfoUnterstützte Dateiformate, Dokumentinformationen, Container-Elemente
Extract TextGesamtes Dokument, formatierter Text, Seitennummernbereich, Dokument in einem Container
Extract ImagesGesamtes Dokument, Seitennummernbereich, Dokument in einem Container
Parse by TemplateVorlage im Benutzerspeicher, Vorlage als Objekt definiert, Dokument in einem Container
Parse by AIDokument per KI mit einer Vorlage parsen
TemplatesVorlage erstellen oder aktualisieren, abrufen und löschen

Beispiele ausführen

  1. Klonen oder laden Sie das Beispiel-Repository herunter
  2. Bearbeiten Sie Examples/Utils.php und setzen Sie Ihre AppSid und AppKey
  3. Wechseln Sie in das Verzeichnis Examples
  4. Führen Sie composer update aus
  5. Führen Sie php RunExamples.php aus

Für weitere Details besuchen Sie Getting Started.


Product Docs Swagger Examples Blog Support Dashboard


Tags

Document Data Extraction | PHP Cloud API | GroupDocs.Parser Cloud | REST API | Text Extraction | Image Extraction | Template Parsing | Data Parsing | Document Information | Container Files | Cloud Storage Integration | File Operations | Folder Operations | Secure API Access | Document Parsing | Metadata Extraction | PDF Parsing | ZIP Files | PST/OST Files | Cross-platform API | Document Processing | Data Extraction API



 Deutsch