Files
XplorePlane/XP.Common/PdfViewer/Interfaces/IPdfPrintService.cs
T

41 lines
2.0 KiB
C#
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
using System;
using System.IO;
using XP.Common.PdfViewer.Exceptions;
namespace XP.Common.PdfViewer.Interfaces
{
/// <summary>
/// PDF 打印服务接口 | PDF print service interface
/// 提供 PDF 文件打印功能 | Provides PDF file printing functionality
/// </summary>
public interface IPdfPrintService
{
/// <summary>
/// 使用指定打印机打印 PDF 文件 | Print PDF file with specified printer
/// </summary>
/// <param name="filePath">PDF 文件路径 | PDF file path</param>
/// <param name="printerName">打印机名称 | Printer name</param>
/// <param name="pageFrom">起始页码(从 1 开始,null 表示从第一页)| Start page (1-based, null for first page)</param>
/// <param name="pageTo">结束页码(从 1 开始,null 表示到最后一页)| End page (1-based, null for last page)</param>
/// <param name="copies">打印份数(默认 1| Number of copies (default 1)</param>
/// <exception cref="FileNotFoundException">文件不存在 | File not found</exception>
/// <exception cref="PdfLoadException">PDF 格式无效 | Invalid PDF format</exception>
/// <exception cref="PrinterNotFoundException">打印机不存在 | Printer not found</exception>
/// <exception cref="PrintException">打印失败 | Print failed</exception>
void Print(string filePath, string printerName, int? pageFrom = null, int? pageTo = null, int copies = 1);
/// <summary>
/// 打开打印设置对话框并打印 | Open print settings dialog and print
/// </summary>
/// <param name="filePath">PDF 文件路径 | PDF file path</param>
/// <returns>用户是否确认打印 | Whether user confirmed printing</returns>
bool PrintWithDialog(string filePath);
/// <summary>
/// 打开打印预览对话框 | Open print preview dialog
/// </summary>
/// <param name="filePath">PDF 文件路径 | PDF file path</param>
void PrintPreview(string filePath);
}
}