
Security News
npm Tooling Bug Incorrectly Marks One-Character Packages as Security Holders
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.
@cap-js/print
Advanced tools
The @cap-js/print package is a CDS plugin that provides print service features through integration with the SAP Print Service.
Using this plugin requires a valid subscription of the SAP Print Service.
To use this plugin to print documents, there are two main steps:
@PDF.PrintableLargeBinary@Core.ContentDisposition: fileName, where fileName is the attribute that specifies the file name or a hardcoded string with the file nameTo use the print plugin, annotate your entity with @PDF.Printable:
@PDF.Printable
entity Books as projection on my.Books;
This annotation does the following things in the background:
print to the annotated entity with the following parameters:
Queue: Name of the print queue to use.Copies: Number of copies to print.File: Only added if the entity has multiple LargeBinary attributes. Allows selecting which file should be printed. Ensure that the LargeBinary properties are annotated with @Common.Label.PrintServiceQueues is added to the service to provide available print queues in a value help.PrintServiceFiles is added to the service to provide available files in a value help (only if multiple LargeBinary attributes exist).You can also use the print service to print documents manually, i.e., without the @PDF.Printable annotations and generated actions and handlers.
Use cases for a manual approach could be:
For this, you can use the cds.connect.to API of CAP to connect to the print service and invoke the print action manually.
const printService = cds.connect.to("PrintService");
await printService.send("print", {
qname: "Printer_Queue_Name",
numberOfCopies: 1,
docsToPrint: [
{
fileName: "file_name.pdf",
content: "<base64-encoded-pdf-content>",
isMainDocument: true,
},
],
});
const queues = await printService.get("/Queues");
It is possible that for LargeBinaries retrieved from the database, the content is provided as a stream. In this case, the stream needs to be converted to base64 before passing it to the print service. For example, see the sample application in test/bookshop/
When running the application locally, the print service is mocked. This mock implementation prints the print job details to the console instead of sending them to the actual print service. It also provides a number of sample print queues for selection.
You can also run the application locally with a binding to the cloud print service with CAP profiles. For more information, see Hybrid Testing. You need an instance of the SAP Print Service.
As the hybrid profile of the plugin uses SAP HANA Cloud to execute integration tests in CI, a profile local is added that can be used to execute the application locally with a binding to the cloud print service.
# Once as setup
cd test/bookshop
cds bind -2 <print-service-instance-name> -4 local
# Run the application (from the root)
npm run watch-sample:local
For CI, the hybrid integration tests are automatically run against a SAP Print Service instance and a SAP HANA Cloud instance created for testing purposes.
This project is open to feature requests/suggestions, bug reports, etc. via GitHub issues. Contributions and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our Contribution Guidelines.
If you find a bug that may be a security problem, please follow the instructions in our security policy on how to report it. Please do not create GitHub issues for security-related doubts or problems.
We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its Code of Conduct at all times.
Copyright 2025 SAP SE or an SAP affiliate company and print contributors. Please see our LICENSE for copyright and license information. Detailed information, including third-party components and their licensing/copyright information, is available via the REUSE tool.
FAQs
CAP plugin for SAP Cloud Print Service.
The npm package @cap-js/print receives a total of 17 weekly downloads. As such, @cap-js/print popularity was classified as not popular.
We found that @cap-js/print demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 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
npm confirmed a tooling bug incorrectly marked several one-character packages as security holders and said it was working on a rollback.

Research
/Security News
Newer packages in this compromise use native extensions and .pth loaders to execute JavaScript stealers in developer environments.

Research
Socket found 37 malicious PyPI wheels that abuse Python startup hooks to launch a Bun-powered credential stealer tied to Mini Shai-Hulud/Miasma.