Share via

How to have print to file generate a unique file name

GerardoCarrillo-4839 20 Reputation points
2026-01-23T18:13:21.94+00:00

Hello, We found ourselves needing to print to file from Oracle fusion. A virtual printer was created and it was setup as a remote print queue and is outputting the file name Print.xml on every print job.

What setup is needed on the windows print server to generate a unique output filename?

Windows for business | Windows Server | User experience | Print jobs
0 comments No comments
{count} votes

Answer accepted by question author
  1. Q&A Assist
    2026-01-23T18:13:33.1933333+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    To generate a unique output filename when printing to file, you would need to modify the setup of your virtual printer on the Windows print server. The current setup outputs a fixed filename (Print.xml) for every print job. To achieve unique filenames, you can create a local port that points to a specific file path, and then implement a method to dynamically generate unique filenames based on certain criteria, such as timestamps or job identifiers.

    Here are the general steps you can follow:

    1. Create a Local Port: Set up a local port in the printer settings that points to a specific directory where you want the files to be saved.
    2. Dynamic Filename Generation: Modify the application or script that sends the print job to include logic for generating a unique filename. This can be done by appending a timestamp or a unique job identifier to the base filename. For example, instead of just "Print.xml", you could use "Print_YYYYMMDD_HHMMSS.xml".
    3. Update Printer Settings: Ensure that the printer settings are configured to use this local port so that each print job saves the file with the unique name generated by your application.

    By implementing these changes, each print job sent to the virtual printer will create a file with a unique name, preventing overwrites and ensuring that all print jobs are saved separately.


    References:

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.