在我的程序中,用户可以选择从文件资源管理器中选择要打印的pdf而不显示对话框。当从代码打印它时,它在PDFControls.NET打印机中输出一个水印‘pdf 2.0PRO’。如果使用打印对话框从程序打印相同的pdf,则没有水印。
上传和打印Excel文件不存在此问题。
在代码中生成pdf文档时,从代码中打印此文档不会在pdf打印输出上添加水印。
我正在使用TallComponents
public void Print( OtherDoc otherDoc )
{
try
{
using ( FileStream sourceFile = new FileStream( otherDoc.Uri, FileMode.Open, FileAccess.ReadWrite, FileShare.None ) )
{
var pdfDoc = new PDF.Document(sourceFile, otherDoc.Password);
this.PrintDoc( pdfDoc );
}
this.PrintResult = PdfPrintResult.Success;
}
catch ( System.UnauthorizedAccessException )
{
this.PrintResult = PdfPrintResult.EditFail;
}
catch ( System.Exception e )
{
this.PrintResult = PdfPrintResult.GeneralFail;
this.PrintError = e.Message;
}
}
private void PrintDoc( PDF.Document pdfDoc )
{
PDF.Printing.PrintSettings printSettings = new PDF.Printing.PrintSettings();
pdfDoc.Print( printSettings );
}在pdf ''PDFControls.NET 2.0 PRO‘’上打印水印,但不应在pdf上打印任何水印
发布于 2019-08-21 08:17:53
我的猜测是你在使用这个试验。如果您有许可证,请确保已将许可证密钥添加到web.config或app.config中,如here所述。
<configuration>
<appsettings>
<add key="PDFKit.NET 4.0 Server Key" value="7206:JUm8jYm-4bwE84gi8RtQuk++" />
</appsettings>
</configuration>如果你已经这样做了,那么你将不得不使用contact TallComponents来获得支持。
https://stackoverflow.com/questions/57582820
复制相似问题