We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Context: #389 (comment)
idea
const inputs = [ { headline: { name: "han-dot", favoriteColor: "blue" }, address: "aa-aa-a" }, ]; const template = { schemas: [ { headline: { type: "text", position: { x: 4.69, y: 7.15 }, width: 186.51, height: 41.98, rotate: 0, opacity: 1, fontSize: 36, fontColor: "#14b351", fontName: "NotoSerifJP-Regular", readOnly: true, readOnlyValue: "Hi {name}, Your favorite color is {favoriteColor}", }, address: { type: "text", position: { x: 4.69, y: 7.15 }, width: 186.51, height: 41.98, rotate: 0, opacity: 1, fontSize: 36, fontColor: "#14b351", fontName: "NotoSerifJP-Regular", }, }, ], basePdf: "base64pdf...", }; const pdf = await generate({ inputs, template, options: { preprocessing: ({ inputs, template }) => { const newInputs = inputs.map((input) => { const newInput = {}; Object.keys(input).forEach((key) => { const value = input[key]; if (typeof value === "object") { const schemaIndex = template.schemas.findIndex( (schema) => schema[key] ); const schema = template.schemas[schemaIndex][key]; const { readOnlyValue } = schema; newInput[key] = readOnlyValue.replace( /{([^}]+)}/g, (_, key) => value[key] ); } else { newInput[key] = key; } }); return newInput; }); return { inputs: newInputs, template }; }, }, });
Using post-processing, it would be possible to add digital signatures.
Add the generate function to allow for custom pre-processing and post-processing.
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Is your feature request related to a problem? Please describe.
Context: #389 (comment)
idea
Using post-processing, it would be possible to add digital signatures.
Describe the solution you'd like
Add the generate function to allow for custom pre-processing and post-processing.
Describe alternatives you've considered
Additional context
No response
The text was updated successfully, but these errors were encountered: