Conn2Flow
Docs navigation

Reference / Libraries

pdf.php library

Loads tFPDF and offers pdf_voucher(), a fixed-layout voucher generator inherited from an old system and with no callers in the core.

Path in the Gestor bibliotecas/pdf.php

When included (gestor_incluir_biblioteca('pdf')), it loads tFPDF (FPDF 1.84 with UTF-8 support) from gestor/bibliotecas/fpdf184/. After that, new tFPDF() is available to generate any PDF; the DejaVu fonts live in fpdf184/font/unifont/.

Its only function is pdf_voucher(), a leftover of a service sales system. No core module uses it.

pdf_voucher($params)

Generates an A4 PDF with the service image, the QR Code, title, customer name, document and phone, and the gestor/assets/images/logo-principal.png logo. It writes to a temporary file (sys_get_temp_dir()/pdf-<hash>) and returns the path; deleting the file is up to the caller.

Required: servicoImg, qrCodeImg, voucherTitulo, nome, documento, telefone. Optional: loteVariacao (shows voucherSubtitulo).

  • With a required one missing, it does nothing and returns null.

  • A missing loteVariacao raises an undefined-variable warning.

  • The name is reduced to the first and last names, texts are cut at 37/28 bytes (accented characters may be split) and the labels are hard-coded in Portuguese.

For new PDFs, use tFPDF directly instead of this function.

Functions

Generated from gestor/bibliotecas/pdf.php · 1 functions

1 of 1

pdf_voucher

view source · line 49 ↗
pdf_voucher(array|false $params = false): string|void

Gera um PDF de voucher com informações do serviço e QR Code.

Parameters

$paramsarray|false
Parâmetros da função.

Returns

string|void
Caminho do arquivo PDF temporário ou void se parâmetros inválidos.

Verified against the code at commit a5ae8605

Sources:

The Future is Hybrid: Human + AI.

Conn2Flow is the tool. If you need the Architect to design your company's strategy using this technology...

Hire Specialized Consulting