Programmatically set filename and path in Microsoft Print to PDF printer

后端 未结 3 1258
春和景丽
春和景丽 2021-01-18 02:30

I have a C# .net program that creates various documents. These documents should be stored in different locations and with different, clearly defined names.

3条回答
  •  北恋
    北恋 (楼主)
    2021-01-18 03:19

    It seems like the PrintFilename is ignored if the PrintToFile property is not set to true. If PrintToFile is set to true and a valid filename (full path) is provided, the filedialog where the user selects filename will not be displayed.

    Tip: When setting the printername of the printersettings you can check the IsValid property to check that this printer actually exists. For more info on printersettings and finding installed printers check this post

提交回复
热议问题