Skip to content

Latest commit

 

History

History
129 lines (86 loc) · 3.83 KB

ConversionApi.md

File metadata and controls

129 lines (86 loc) · 3.83 KB

PDFGeneratorAPI\ConversionApi

All URIs are relative to https://us1.pdfgeneratorapi.com/api/v4, except if the operation defines another base path.

Method HTTP request Description
convertHTML2PDF() POST /conversion/html2pdf HTML to PDF
convertURL2PDF() POST /conversion/url2pdf URL to PDF

convertHTML2PDF()

convertHTML2PDF($convert_html2_pdf_request): \PDFGeneratorAPI\Model\GenerateDocument201Response

HTML to PDF

Converts HTML content to PDF

Example

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


// Configure Bearer (JWT) authorization: JSONWebTokenAuth
$config = PDFGeneratorAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new PDFGeneratorAPI\Api\ConversionApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$convert_html2_pdf_request = new \PDFGeneratorAPI\Model\ConvertHTML2PDFRequest(); // \PDFGeneratorAPI\Model\ConvertHTML2PDFRequest

try {
    $result = $apiInstance->convertHTML2PDF($convert_html2_pdf_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversionApi->convertHTML2PDF: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
convert_html2_pdf_request \PDFGeneratorAPI\Model\ConvertHTML2PDFRequest

Return type

\PDFGeneratorAPI\Model\GenerateDocument201Response

Authorization

JSONWebTokenAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

convertURL2PDF()

convertURL2PDF($convert_url2_pdf_request): \PDFGeneratorAPI\Model\GenerateDocument201Response

URL to PDF

Converts public URL to PDF

Example

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


// Configure Bearer (JWT) authorization: JSONWebTokenAuth
$config = PDFGeneratorAPI\Configuration::getDefaultConfiguration()->setAccessToken('YOUR_ACCESS_TOKEN');


$apiInstance = new PDFGeneratorAPI\Api\ConversionApi(
    // If you want use custom http client, pass your client which implements `GuzzleHttp\ClientInterface`.
    // This is optional, `GuzzleHttp\Client` will be used as default.
    new GuzzleHttp\Client(),
    $config
);
$convert_url2_pdf_request = new \PDFGeneratorAPI\Model\ConvertURL2PDFRequest(); // \PDFGeneratorAPI\Model\ConvertURL2PDFRequest

try {
    $result = $apiInstance->convertURL2PDF($convert_url2_pdf_request);
    print_r($result);
} catch (Exception $e) {
    echo 'Exception when calling ConversionApi->convertURL2PDF: ', $e->getMessage(), PHP_EOL;
}

Parameters

Name Type Description Notes
convert_url2_pdf_request \PDFGeneratorAPI\Model\ConvertURL2PDFRequest

Return type

\PDFGeneratorAPI\Model\GenerateDocument201Response

Authorization

JSONWebTokenAuth

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]