从我的代码打印外部选择的pdf时,水印'PDFControls.NET 2.0 PRO'添加到打印输出中



在我的程序中,用户可以选择从文件资源管理器中进行选择,即无需显示对话框即可打印的pdf。从代码打印时,它会在 pdf 打印机中输出水印"PDFControls.NET 2.0 PRO"。如果从程序中打印相同的pdf,并带有打印对话框,则没有水印。

上传和打印 Excel 文件不存在此问题。

在代码中生成 pdf 文档时,从代码中打印此文档不会在 pdf 打印输出上添加水印。

我正在使用高组件

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 上打印任何水印

我的猜测是你正在使用试用版。如果您有许可证,请确保已将许可证密钥添加到 web.config 或 app.config,如此处所述。

<configuration>
<appsettings>
<add key="PDFKit.NET 4.0 Server Key" value="7206:JUm8jYm-4bwE84gi8RtQuk++" />
</appsettings>
</configuration>

如果您已经这样做了,那么您必须联系 TallComponents 寻求支持。

最新更新