From 8e9b99ccb094e5695efc88b157d76feb6d5d6776 Mon Sep 17 00:00:00 2001 From: OpenClaw Date: Sun, 22 Feb 2026 10:03:27 +0000 Subject: [PATCH] fix: add Go, PHP, Laravel examples to source file (examples.html) --- public/examples.html | 57 ++++++++++++++++++++++++++++++++++++++++ public/src/examples.html | 57 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) diff --git a/public/examples.html b/public/examples.html index c361fd4..403b7fb 100644 --- a/public/examples.html +++ b/public/examples.html @@ -340,6 +340,63 @@ response.raise_for_status() + +
+

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/src/examples.html b/public/src/examples.html index f98b9c6..34920ee 100644 --- a/public/src/examples.html +++ b/public/src/examples.html @@ -289,6 +289,63 @@ response.raise_for_status() + +
+

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');
+
+
+