Security News
PyPI’s New Archival Feature Closes a Major Security Gap
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
@protacon/pdf-template-builder
Advanced tools
[![npm version](https://badge.fury.io/js/%40protacon%2Fpdf-template-builder.svg)](https://badge.fury.io/js/%40protacon%2Fpdf-template-builder) [![Build Status](https://jenkins.protacon.cloud/buildStatus/icon?job=www.github.com/pdf-template-builder/master)
Template builder for pdf-storage
The pdf-template-builder
is designed to be used as a embedded tool inside other applications
communicating with the pdf-storage service. This repo contains the builder as a
pure React component which can be used in React app in React way.
See working example with full configuration at https://github.com/protacon/how-to-react-pdf-template-builder
npm i @protacon/pdf-template-builder
import PdfTemplateBuilder from '@protacon/pdf-template-builder';
<PdfTemplateBuilder
language={this.state.language}
template={this.state.template}
schema={new Schema().forExample()}
onPreview={this.handlePreview}
onSaveTemplate={this.handleSave}
/>
Embedded builder language. Supported options are en
and fi
. Defaults to en
.
Template you want to modify. This template object should be in proper template object format. Absolutely best way to create one is to save template from the builder and take object from that output. Defaults to undefined
which means we are creating a new template.
The object configuration which allows you to configure certain keys to be binded to the template. For example you may want to bind invoice's number to the invoice, so you configure a schema object with key invoiceNumber
which you can bind to certain element in your template. Later template will be populated using the proper invoice data and the invoiceNumber
placeholder will be filled up with the invoice's number. Defaults to empty array.
[
{
type: 'text|group|image',
tag: 'invoiceNumber',
text: 'Invoice Number',
example: '12345'
}
]
Enables the preview button to the builder. When preview button is clicked, the callback defined will be called with the templateHtml
, templateData
and pageOptions
parameters which you can utilize in any way you want, usually just create a preview of the PDF using these parameters. Parameters are straightly compatible with the pdf-storage API. Defaults to undefined
, no preview button is shown.
...
onPreview={(templateHtml, templateData, pageOptions) => console.log(templateHtml, templateData, pageOptions))}
...
Enables the save button to the builder. When save button is clicked, the callback defined will be called with the template
and templateHtml
parameters. Using the template
object the builder can be repopulated and the template can be opened under edit again later. Maybe store the template
as JSON string to database? Defaults to undefined
, no save button is shown.
You'd better to have node.js installed.
To get started with the development run following commands
npm install
npm start
and navigate to the http://localhost:3000
with your favourite browser.
FAQs
[![npm version](https://badge.fury.io/js/%40protacon%2Fpdf-template-builder.svg)](https://badge.fury.io/js/%40protacon%2Fpdf-template-builder) [![Build Status](https://jenkins.protacon.cloud/buildStatus/icon?job=www.github.com/pdf-template-builder/master)
The npm package @protacon/pdf-template-builder receives a total of 1 weekly downloads. As such, @protacon/pdf-template-builder popularity was classified as not popular.
We found that @protacon/pdf-template-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PyPI now allows maintainers to archive projects, improving security and helping users make informed decisions about their dependencies.
Research
Security News
Malicious npm package postcss-optimizer delivers BeaverTail malware, targeting developer systems; similarities to past campaigns suggest a North Korean connection.
Security News
CISA's KEV data is now on GitHub, offering easier access, API integration, commit history tracking, and automated updates for security teams and researchers.