Portix.One

example · applications

Invoice Printer Example

By Portix.One Published
A versioned invoice artifact printed through a browser or authenticated local adapter

Quick answer

Issue the invoice on the server, generate a versioned PDF from its immutable fiscal data, store its checksum, and print that artifact. Use the browser dialog for interactive printing or an authenticated local adapter for controlled workstation routing.

Quick answer

Issue the invoice on the server, generate a versioned PDF from its immutable fiscal data, store its checksum, and print that artifact. Use the browser dialog for interactive printing or an authenticated local adapter for controlled workstation routing.

type InvoiceArtifact = {
  invoiceId: string;
  version: number;
  pdfUrl: string;
  sha256: string;
  issuedAt: string;
};

async function printInvoice(artifact: InvoiceArtifact) {
  const jobId = `${artifact.invoiceId}:v${artifact.version}:${artifact.sha256}`;
  // Interactive: open a same-origin PDF view and let the user print.
  // A Portix-routed print path isn't documented yet.
  return jobId;
}

Do not regenerate a historical invoice from current customer or catalog records. Corrections should create the legally appropriate new version, credit note, or replacement according to the jurisdiction. Validate any remote artifact URL and do not expose unrestricted local-runtime fetches.

Verify

  • PDF page size, margins, fonts, and pagination are stable.
  • Stored checksum matches the printed artifact.
  • Duplicate requests reuse the logical job.
  • Access control protects invoice URLs.
  • Correction and reprint policies are auditable.

Related content