i have done it using pdfcreator. it is a a free pdf software. u can search for pdfcreator and u will be able to find some sample code in the discussion to get u started
You will need to code the routine using the PDF generator (e.g. PDFCreator, BullZip) as an automation and call it with the filename. As Jordi suggests - search for detailed posts on this.
Whatever PDF Printer you are using needs a filename. If you can’t supply it through the code you may need to switch to something like PDFCreator. There are lots of posts on how to add this automation code to your NAV Business Logic.