Install the official SDK: go get github.com/docfast/docfast-go
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)
+}
+ Install the official SDK: composer require docfast/docfast-php
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);
+ use DocFast\Laravel\Facades\DocFast;
+
+// In your controller
+$pdf = DocFast::html(view('invoice')->render());
+return response($pdf)
+ ->header('Content-Type', 'application/pdf');
+ Install the official SDK: go get github.com/docfast/docfast-go
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)
+}
+ Install the official SDK: composer require docfast/docfast-php
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);
+ use DocFast\Laravel\Facades\DocFast;
+
+// In your controller
+$pdf = DocFast::html(view('invoice')->render());
+return response($pdf)
+ ->header('Content-Type', 'application/pdf');
+