Two lounge chairs cost the studio $240 each. With a 25% markup, the client approves $300 per chair, or $600 total. The chair supplier needs the approved finish, quantity, and its $240 quoted unit cost. The same room also contains a pendant awaiting approval. The client needs to see it in the spec sheet, and the supplier's order needs to exclude it until approval.
Build each export from its own rows
Keep a revision and stable item IDs on the room-by-room schedule for furniture, fixtures, and equipment. The client view includes proposals and approvals with sell prices. The vendor view filters for both approval and vendor ID, then copies only the fields needed to place the order. Keep internal notes and pricing rules in the source schedule. Create each PDF from the corresponding projected rows. Drawing a box over a price can leave the text in the document's content stream. pdf-lib PDFDocument API
The sample prices the unit first and extends it by quantity. It rounds a nonnegative result half up to a cent, so the visible unit price times quantity always agrees with the line total. Markup here means a percentage of cost. A $60 markup on a $240 unit is 25% of cost and 20% of the $300 sell price.
Save the block as ffe.mts. In a scratch directory, run npm install pdf-lib@1.17.1, then run node ffe.mts using Node.js 24. The script writes client-approval.pdf and vendor-studio-seating.pdf. Node.js TypeScript support
import assert from "node:assert/strict"; import { writeFile } from "node:fs/promises"; import { PDFDocument, StandardFonts } from "pdf-lib"; type Item = { id: string; room: string; item: string; finish: string; qty: bigint; status: "proposed" | "approved"; vendor: string; costCents: bigint; markupBps: bigint; internalNote: string; }; type Schedule = { revision: string; items: Item[] }; type SpecRow = Pick<Item, "id" | "room" | "item" | "finish" | "qty">; type ClientRow = SpecRow & { status: Item["status"]; sellCents: bigint }; type VendorRow = SpecRow & { costCents: bigint }; function copySpec({ id, room, item, finish, qty }: Item): SpecRow { return { id, room, item, finish, qty }; } function clientRows(schedule: Schedule): ClientRow[] { return schedule.items.map((row) => ({ ...copySpec(row), status: row.status, sellCents: (row.costCents * (10_000n + row.markupBps) + 5_000n) / 10_000n, })); } function vendorRows(schedule: Schedule, vendor: string): VendorRow[] { return schedule.items .filter((row) => row.vendor === vendor && row.status === "approved") .map((row) => ({ ...copySpec(row), costCents: row.costCents })); } const usd = (cents: bigint) => `$${cents / 100n}.${String(cents % 100n).padStart(2, "0")}`; function specLines<Row extends SpecRow>(rows: Row[], details: (row: Row) => string): string[] { return rows.flatMap((row) => [ `${row.room} | ${row.id} | ${row.item} | ${row.finish} | Qty ${row.qty}`, details(row), ]); } async function render(title: string, revision: string, lines: string[]): Promise<Uint8Array> { const doc = await PDFDocument.create(); const font = await doc.embedFont(StandardFonts.Helvetica); const header = `${title} | Revision ${revision}`; for (let i = 0; i < Math.max(1, lines.length); i += 36) { const page = doc.addPage([612, 792]); [header, ...lines.slice(i, i + 36)].forEach((line, index) => { const size = index === 0 ? 14 : 11; assert(font.widthOfTextAtSize(line, size) <= 540, `Line too wide: ${line}`); page.drawText(line, { x: 36, y: index === 0 ? 750 : 738 - index * 17, size, font }); }); } return doc.save(); } const schedule: Schedule = { revision: "03", items: [ { id: "L-01", room: "Living Room", item: "Lounge chair", finish: "Natural oak", qty: 2n, status: "approved", vendor: "Studio Seating", costCents: 24_000n, markupBps: 2500n, internalNote: "PRIVATE-NEGOTIATION" }, { id: "L-02", room: "Living Room", item: "Pendant", finish: "Brass", qty: 1n, status: "proposed", vendor: "Studio Seating", costCents: 19_999n, markupBps: 2500n, internalNote: "Check canopy dimensions" }, { id: "G-01", room: "Guest Room", item: "Floor lamp", finish: "Matte black", qty: 1n, status: "approved", vendor: "Beacon Lighting", costCents: 16_000n, markupBps: 2000n, internalNote: "Hold alternative quote" }, ], }; const client = clientRows(schedule); const vendor = vendorRows(schedule, "Studio Seating"); assert.deepEqual(client.map((row) => row.sellCents * row.qty), [60_000n, 24_999n, 19_200n]); assert.deepEqual(vendor, [ { id: "L-01", room: "Living Room", item: "Lounge chair", finish: "Natural oak", qty: 2n, costCents: 24_000n }, ]); assert(client.every((row) => !("costCents" in row) && !("internalNote" in row) && !("markupBps" in row))); const clientPdf = await render("Client approval", schedule.revision, specLines(client, (row) => { const { status, sellCents } = row; return `${status} | Unit ${usd(sellCents)} | Total ${usd(sellCents * row.qty)}`; })); const vendorPdf = await render("Vendor spec - Studio Seating", schedule.revision, specLines(vendor, (row) => `Quoted unit cost ${usd(row.costCents)}`)); assert.equal((await PDFDocument.load(clientPdf)).getPageCount(), 1); assert.equal((await PDFDocument.load(vendorPdf)).getPageCount(), 1); await writeFile("client-approval.pdf", clientPdf); await writeFile("vendor-studio-seating.pdf", vendorPdf); console.log("Wrote client-approval.pdf and vendor-studio-seating.pdf for revision 03"); The fixture uses short lines and Helvetica. For a production schedule, validate quantities and prices when importing rows, group the export by room, embed a font that covers the project's characters, and wrap long descriptions before paginating. If Poppler is installed, run pdftotext vendor-studio-seating.pdf - to check the actual output. It should show L-01 and $240.00. The client prices, pending item, and other supplier's item belong outside that file.
The same vendor rows can feed an XLSX order sheet. Keep the revision and item IDs in both exports so a buyer can trace each approved line back to the client packet. For a packaged workflow that pairs the approval PDF with a vendor procurement workbook, see FFESpecPack.

