为什么看不到这个问题的答案?
我也遇到了同样的问题,这是我最后找到的解决方案,希望对有同样问题的人有所帮助。
https://visualstudiogallery./b590710c-efe6-4667-842e-2a592ce000cc
using System;
using System.Drawing.Printing;
using System.Windows.Forms;
using Spire.Pdf;
namespace 静默打印PDF
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
var doc = new PdfDocument();
doc.LoadFromFile("文档路径");
PrintDocument printDoc = doc.PrintDocument;
printDoc.PrintController = new StandardPrintController();
printDoc.Print();
doc.Close();
}
}
}