Some Serial Invoice

Free Text Pos
Minor Changes
This commit is contained in:
2024-09-29 19:17:26 +02:00
parent 5d7714519a
commit a75506b183
3 changed files with 179 additions and 9 deletions

View File

@@ -837,17 +837,17 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
rowHeight += 3
}
let textAutoLines = (row.text.match(/.{1,70}/g) || []).length
let textAutoLines = (row.text.match(/.{1,60}/g) || []).length
pages[pageCounter - 1].drawRectangle({
...getCoordinatesForPDFLib(20,rowHeight, page1),
width: 180 * 2.83,
height: 8 * 3,
height: 8 * 2.83,
color: rgb(0,0,0),
opacity: 0.25
})
pages[pageCounter - 1].drawText(row.text.match(/.{1,70}/g).join("\n"), {
pages[pageCounter - 1].drawText(row.text.match(/.{1,60}/g).join("\n"), {
...getCoordinatesForPDFLib(21,rowHeight - 3, page1),
size:12,
color:rgb(0,0,0),
@@ -861,7 +861,7 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
if(row.description) {
pages[pageCounter - 1].drawText(row.description.match(/.{1,85}/g).join("\n"), {
pages[pageCounter - 1].drawText(row.description.match(/.{1,80}/g).join("\n"), {
...getCoordinatesForPDFLib(21,rowHeight + ( textAutoLines * 4), page1),
size:10,
color:rgb(0,0,0),
@@ -870,7 +870,7 @@ export const useCreatePdf = async (invoiceData,backgroundSourceBuffer) => {
})
}
let addHeight = ((row.description.match(/.{1,85}/g) || []).length + textAutoLines) * 8
let addHeight = (row.description.match(/.{1,80}/g) || []).length * 4 + 10
console.log(addHeight)
rowHeight += addHeight