diff --git a/public/examples.html b/public/examples.html index bbd98b6..ebf172d 100644 --- a/public/examples.html +++ b/public/examples.html @@ -4,7 +4,7 @@ Code Examples — DocFast HTML to PDF API - + @@ -113,6 +113,8 @@ footer .container { display: flex; justify-content: space-between; align-items: Receipt Node.js Python + Go + PHP @@ -348,6 +350,63 @@ pdf = response.content + +
+

Go Integration

+

Install the official SDK: go get github.com/docfast/docfast-go

+
+ Go — Using the SDK +
package main
+
+import (
+    "os"
+    docfast "github.com/docfast/docfast-go"
+)
+
+func main() {
+    client := docfast.New("df_pro_your_api_key")
+
+    pdf, err := client.HTML("<h1>Hello</h1><p>Generated with DocFast</p>", &docfast.PDFOptions{
+        Format: "A4",
+        Margin: &docfast.Margin{Top: "20mm", Bottom: "20mm"},
+    })
+    if err != nil {
+        panic(err)
+    }
+    os.WriteFile("output.pdf", pdf, 0644)
+}
+
+
+ + +
+

PHP Integration

+

Install the official SDK: composer require docfast/docfast-php

+
+ PHP — Using the SDK +
use DocFast\Client;
+use DocFast\PdfOptions;
+
+$client = new Client('df_pro_your_api_key');
+
+$options = new PdfOptions();
+$options->format = 'A4';
+$options->margin = ['top' => '20mm', 'bottom' => '20mm'];
+
+$pdf = $client->html('<h1>Hello</h1><p>Generated with DocFast</p>', null, $options);
+file_put_contents('output.pdf', $pdf);
+
+
+ Laravel — Using the Facade +
use DocFast\Laravel\Facades\DocFast;
+
+// In your controller
+$pdf = DocFast::html(view('invoice')->render());
+return response($pdf)
+    ->header('Content-Type', 'application/pdf');
+
+
+ diff --git a/public/index.html b/public/index.html index f29341e..0d7c5a6 100644 --- a/public/index.html +++ b/public/index.html @@ -57,10 +57,10 @@ }, { "@type": "Question", - "name": "Do you have SDKs for Node.js and Python?", + "name": "Do you have official SDKs?", "acceptedAnswer": { "@type": "Answer", - "text": "Yes, DocFast provides official SDKs for both Node.js and Python. You can also use the REST API directly with curl or any HTTP client in your preferred language." + "text": "Yes, DocFast provides official SDKs for Node.js, Python, Go, PHP, and Laravel. You can also use the REST API directly with curl or any HTTP client." } } ] @@ -450,7 +450,7 @@ html, body {

Everything you need

-

Official SDKs for Node.js and Python. Or just use curl.

+

Official SDKs for Node.js, Python, Go, PHP, and Laravel. Or just use curl.