# MX\_LASTPRTFIL

> [HTML Version](mx_lastprtfil.htm)

_Updated February 2022; see History_

**xcall MIAMEX, MX\_LASTPRTFIL, fspec**

MX\_LASTPRTFIL (MIAMEX 186) returns the file spec of the last file written by the PDFX printer driver.

**Parameters**

_fspec_  ([String](string.md))  \[out\] 

return the filespec

Currently this only works for PDFX5+, where it solves the problem of finding out the actual name of the PDF file which otherwise may be unknowable due to auto-numbering strategies in the driver, or due to the operator using the Save As dialog to rename the file. The feature may be expanded in the future to support other similar printing situations.

**History**

2022 February, A-Shell 6.5.1711:  MX\_LASTPTRFIL previously worked properly only if the WAIT option was used in the prior SPOOL request. It now returns the last filespec written by the PDF-XChange Standard driver (for the current session) regardless of the switches. But since the file writing operation is asynchronous, the WAIT option is still required to be sure that the filespec returned is from the last print request and not from a prior one if the application has gotten ahead of the printer driver.

2016 February, A-Shell 6.3.1509:  Routine added to A-Shell