Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Way to default the name of the generated XPS file?

Tags:

People also ask

What does XPS file format stand for?

The XML Paper Specification (XPS) format is basically an electronic representation of digital documents based on XML. It is a paginated fixed-layout format that retains the look and feel of your electronic documents.

How is XPS format?

An XPS file represents a document with a fixed layout, just as a PDF file does. XPS also includes support for other features that you'd find in PDF, like digital signatures and DRM. XPS is now technically a standardized, open format – it stands for Open XML Paper Specification.

Why did Microsoft create the XPS file format?

An XPS file represents page layout files that are based on XML Paper Specifications created by Microsoft. It was developed as a replacement of EMF file format and is similar to PDF file format, but uses XML in layout, appearance, and printing information of a document.


If a user prints a report, and they happen to be using the Microsoft XPS printer, i would like the default the filename to something meaningful.

i would have thought that the XPS printer would take the name of the print job, and use that as the default filename - but it doesn't.

Is there some other, programatic, way to default the name of the generated XPS file when i print to that printer? i was thinking there might be something like:

  • a registry key
  • global shared memory
  • API call like SetDefaultXPSFilename()
  • extended attributes about a print job

Example

Automate Excel to create a spreadsheet:

Excel xl = new ExcelApplication();
Workbook wb = xl.Workbooks.Add();
GenerateReport(wb);
wb.PrintOut();

Now if the user's default printer is the Microsoft XPS Document Writer, then the user will get:

enter image description here

i would like a way for that File name to be defaulted to something useful, such as:

20110729 - Chip Bank Settlement Sheet.xps

The user will accept the default filename, and files will organized automatically, rather than the user typing:

asdfadf.xps

References

  • eggheadcafe: XPS Default File Name
  • MSDN: XPS Name when Sent to Printer

Bump: 20110729 (12 months later)