function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion

Is it possible to print using a printer using Apex code?



I have to print the current page using the printer connected to my system.
I would like to open the 'Print Option' using Apex code.
Is this possible?
Please help...



I doubt you'd be able to do this via APEX, as that is server side.  You can do this via JavaScript that executes client-side, so if you are using VisualForce or a custom button it should be possible.


The JavaScript is : window.print();


This will open the print dialog for the browser.