
Research
/Security News
9 Malicious NuGet Packages Deliver Time-Delayed Destructive Payloads
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.
@diplodoc/pdf-generator
Advanced tools
Package to turn Diplodoc projects into PDFs.
npm i -g @diplodoc/pdf-generator
Run @diplodoc/cli command. This will create an output folder with a single page file for each Table of Contents (ToC) file.
npx -- @diplodoc/cli@latest -i ./docs -o ./docs-output --pdf
Run the @diplodoc/pdf-generator command. This will create PDF files right next to the single page ones.
npx -- @diplodoc/pdf-generator@latest -i ./docs-output
The tool also provides users with flexible customization of headers and footers in the form of HTML format files, the paths to which can be passed through the corresponding options --custom-header and --custom-footer.
By default, the header is not set, but the page numbering in the lower right corner is set in the footer, as shown in the example below.
npx -- @diplodoc/pdf-generator@latest -i ./docs-output
Also below is an example of a command with custom header (example-custom-header.html) and custom footer (example-custom-footer.html).
Even if you specify a custom footer, the numbering still remains in the lower right corner.
npx -- @diplodoc/pdf-generator@latest -i ./docs-output --custom-header ./example-custom-header.html --custom-footer ./example-custom-footer.html
| Option | Type | Necessary | Default value | Description |
|---|---|---|---|---|
custom-header | string (filepath) | No | "" | Path to HTML file with custom header content for generated PDF pages. |
custom-footer | string (filepath) | No | <div style="position: relative;width: 100%;height: 0;"><div style="position: absolute;right: 20px;bottom: 0;font-size: 10px;z-index: 0;padding: 0 5px;background: white;"><span class="pageNumber"></span></div></div> | Path to HTML file with custom footer content for generated PDF pages. |
Examples of generated pdf pages with custom headers and footers are available on screenshots tests/image_snapshots /custom-headers-test-ts-integration-works-on-page-*
Follow this guide to install the required dependencies.
npm run test
FAQs
Package to turn Diplodoc projects into PDFs
The npm package @diplodoc/pdf-generator receives a total of 195 weekly downloads. As such, @diplodoc/pdf-generator popularity was classified as not popular.
We found that @diplodoc/pdf-generator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 7 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.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.