You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+10-11Lines changed: 10 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,8 +11,7 @@ CDS plugin for SAP Print service (package `@cap-js/print`) is a CDS plugin that
11
11
12
12
## Requirements and Setup
13
13
14
-
15
-
Usage of this plugin requires a valid subscription of the [SAP Print Service](https://help.sap.com/docs/SCP_PRINT_SERVICE).
14
+
Using this plugin requires a valid subscription of the [SAP Print Service](https://help.sap.com/docs/SCP_PRINT_SERVICE).
16
15
17
16
## Usage
18
17
@@ -21,14 +20,14 @@ To use this plugin to print documents, there are two main steps:
21
20
1. Ensure your model meets the requirements
22
21
2. Annotate your CDS model with `@PDF.Printable`
23
22
24
-
### Model requirements
23
+
### Model Requirements
25
24
26
25
- The attribute(s) you want to print are of type `LargeBinary`
27
26
- Those attributes have the annotation `@Core.ContentDisposition: fileName`, where `fileName` is the attribute that specifies the file name or a hardcoded string with the file name
28
27
29
28
### Annotations in CDS model
30
29
31
-
To use the print plugin, simply annotate your entity with `@PDF.Printable`:
30
+
To use the print plugin, annotate your entity with `@PDF.Printable`:
32
31
33
32
```cds
34
33
@PDF.Printable
@@ -38,8 +37,8 @@ entity Books as projection on my.Books;
38
37
This annotation does the following things in the background:
39
38
40
39
- Adds an action `print` to the annotated entity with the following parameters:
41
-
-`Queue`: Name of the print queue to use
42
-
-`Copies`: Number of copies to print
40
+
-`Queue`: Name of the print queue to use.
41
+
-`Copies`: Number of copies to print.
43
42
-`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`.
44
43
- This action is added to the UI and a handler is generated to process the print request.
45
44
- An entity `PrintServiceQueues` is added to the service to provide available print queues in a value help.
@@ -52,7 +51,7 @@ You can also use the print service to print documents manually, i.e., without th
52
51
Use cases for a manual approach could be:
53
52
- You want to print documents that are not part of your CDS model, i.e., files generated at runtime
54
53
- Your model does not meet the requirements for the automatic approach
55
-
- You want to print another file type than PDF
54
+
- You want to print a file type other than PDF
56
55
57
56
For this, you can use the `cds.connect.to` API of CAP to connect to the print service and invoke the `print` action manually.
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, have a look at the sample application in `test/bookshop/`
76
+
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/`
78
77
79
78
## Local Development
80
79
81
-
When running the application locally, i.e., `cds watch`, 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.
80
+
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.
82
81
83
82
## Hybrid Testing
84
83
@@ -103,11 +102,11 @@ For CI, the hybrid integration tests are automatically run against a SAP Print S
103
102
104
103
## Support, Feedback, Contributing
105
104
106
-
This project is open to feature requests/suggestions, bug reports, etc. via [GitHub issues](https://github.com/cap-js/print/issues). Contribution 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](CONTRIBUTING.md).
105
+
This project is open to feature requests/suggestions, bug reports, etc. via [GitHub issues](https://github.com/cap-js/print/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](CONTRIBUTING.md).
107
106
108
107
## Security / Disclosure
109
108
110
-
If you find any bug that may be a security problem, please follow the instructions [in our security policy](https://github.com/cap-js/print/security/policy) on how to report it. Please do not create GitHub issues for security-related doubts or problems.
109
+
If you find a bug that may be a security problem, please follow the instructions [in our security policy](https://github.com/cap-js/print/security/policy) on how to report it. Please do not create GitHub issues for security-related doubts or problems.
0 commit comments