PHP code example of adminweb / websheet-php

1. Go to this page and download the library: Download adminweb/websheet-php library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

adminweb / websheet-php example snippets




bSheet\Sdk\Pdf;

$pdf = new Pdf('api-key');

$content = '<html>
                <head>
                    <meta charset="utf-8">
                    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Tangerine">
                    <style>
                        body {font-family: "Tangerine", serif;font-size: 48px; text-shadow: 4px 4px 4px #aaa;}
                    </style>
                </head>
                <body>
                    <div>Making the Web Beautiful!</div>
                </body>
            </html>';

$result = $pdf->make('almost finalizado', $content);

echo $result->id; // ID of file
echo $result->name; // Name of file
echo $result->url; // URL of created PDF file
// Creation date of Pdf file (returns DateTime object) (and formats brazilian format here)
echo $result->createdAt->format('d/m/Y '); 



bSheet\Sdk\Pdf;

$pdf = new Pdf('api-key');

$content = '<html>
                <head>
                    <meta charset="utf-8">
                    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Tangerine">
                    <style>
                        body {font-family: "Tangerine", serif;font-size: 48px; text-shadow: 4px 4px 4px #aaa;}
                    </style>
                </head>
                <body>
                    <div>Making the Web Beautiful!</div>
                </body>
            </html>';
            
// The generated file will send by email to destinatary
$result = $pdf->setDestinatary('[email protected]')->make('almost finalizado', $content); 



bSheet\Sdk\Pdf;

$pdf = new Pdf('api-key');

$content = '<html>
                <head>
                    <meta charset="utf-8">
                    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Tangerine">
                    <style>
                        body {font-family: "Tangerine", serif;font-size: 48px; text-shadow: 4px 4px 4px #aaa;}
                    </style>
                </head>
                <body>
                    <div>Making the Web Beautiful!</div>
                </body>
            </html>';

// The generated file will send by email to destinatary 
// with template registered in https://websheet.tech
$result = $pdf->setDestinatary('[email protected]')
              ->setTemplate('template ID')
              ->make('almost finalizado', $content); 
shell
 $ composer