When going to the sales invoices page in business central, you can print an invoice and you will get the following popup:
Here you can select a printer in the printer dropdown, we then catch that printer name in the OnBeforeMergeDocument event, which gives you the printername as an argument.
The problem is, this only works when you press the print button at the bottom of the popup in the image, if you press preview, it will give you an empty string.
I need the printername in both situations, is it possible to get the printername when previewing?