mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 16:35:42 +00:00
Marshaling doc fix
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import { Injectable } from '@nestjs/common';
|
||||
|
||||
import { PdfRenderService } from '../billing/documents/pdf-render.service';
|
||||
import { buildTabularFallbackPdf } from '../billing/documents/styled-pdf.util';
|
||||
|
||||
const MIN_VALID_PDF_BYTES = 2_000;
|
||||
|
||||
@@ -32,6 +33,19 @@ export class WarehouseReleaseDocumentService {
|
||||
return this.pdf.htmlToPdfBuffer(html, { label });
|
||||
}
|
||||
|
||||
/**
|
||||
* Render a "summary tiles + one table + notice + signatures" document (the
|
||||
* marshalling / load-list layout) with a STYLED table-aware fallback for when
|
||||
* Chromium is unavailable — so the manifest draws as a real gridded document
|
||||
* instead of a flat plain-text dump.
|
||||
*/
|
||||
renderTabularDocument(html: string, label = 'Document'): Promise<Buffer> {
|
||||
return this.pdf.htmlToPdfBuffer(html, {
|
||||
label,
|
||||
fallback: (preparedHtml) => buildTabularFallbackPdf(preparedHtml),
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Render document HTML with a STYLED hand-built fallback (the release layout,
|
||||
* but with a custom title + section heading) for when Chromium is unavailable.
|
||||
|
||||
Reference in New Issue
Block a user