Skip to main content

Printing via API

Can I print documents using the API?

Written by Petr Pech

You can't invoke the print dialog you know from the application via the API — the API is an interface without a user interface. What you can do, however, is have the print output itself generated.


Print report as PDF

Just add the .pdf extension to the document address:

GET /c/{firma}/faktura-vydana/123.pdf
GET /c/{firma}/faktura-vydana/123.pdf?report-name=faktura

Without a parameter, the default report of the record type is used. The specific report is selected by report-name; the list of available reports is returned by the address /c/{firma}/{evidence}/reports.xml, and the parameter should contain the value from the reportId element.

⚠️ A report name that isn't in the list results in the response 500 and the message Report '…' can't be found — not an empty PDF. Always take the value from the list of reports.


Other options


Related

Did this answer your question?