Print to PDF

Stimulsoft Reports.JS discussion
Post Reply
ScottStoneback
Posts: 18
Joined: Tue Jan 12, 2016 11:13 pm

Print to PDF

Post by ScottStoneback »

Is it possible from the viewer to convert the active report to PDF and then print it? The behavior that I'm looking for is when the user clicks on the Print button that the report is converted to PDF and then printed directly. The reason I need this behavior is because in some browsers, it adds information to the printout including the url, page number, date, etc on the printout and that messes up the format of my report, usually adding additional pages to it. If there is some other method of doing this I'd be open to suggestions.
Thanks,
Scott
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Print to PDF

Post by HighAley »

Hello, Scott.

We disabled this feature, because there are some limitation of JavaScript that don't allow to to this.
We can add a Print to PDF feature. But you should then send this file to your server from a Viewer event and return it back to the browser.
Do you accept such way of printing to PDF?

Thank you.
ScottStoneback
Posts: 18
Joined: Tue Jan 12, 2016 11:13 pm

Re: Print to PDF

Post by ScottStoneback »

Yes that would be completely fine. Right now what I'm doing is capturing the current print event and calling a server method which returns me a pdf stream. And then I print that pdf document. And then I'm using e.preventDefault = true in the print event to stop the default print from happening. It would be nice if I didn't need to render my report twice on the server.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Print to PDF

Post by HighAley »

Hello, Scott.

OK. We will made an improvement and will let yo know when it will be available.

Thank you.
HighAley
Posts: 8430
Joined: Wed Jun 08, 2011 7:40 am
Location: Stimulsoft Office

Re: Print to PDF

Post by HighAley »

Hello.

We have implemented the Print to PDF feature.
Please, look at the latest build that is available on our site.

Thank you.
Post Reply