Hello,
Thank you for your feedback.
I tested your PDF file again on Windows 10, but still did not reproduce your issue. Since we do not have the type of printer you are using, please use XpsPrint (the attachment is the XpsPrintHelper package) to check whether the problem is related to ZDesigner GK888t printer. The test code is as follows:
- Code: Select all
Spire.Pdf.PdfDocument pdfdocument = new Spire.Pdf.PdfDocument();
pdfdocument.LoadFromStream(request.PdfFile.OpenReadStream());
MemoryStream ms = new MemoryStream();
pdfdocument.SaveToStream(ms, FileFormat.XPS);
ms.Position = 0;
XpsPrint.XpsPrintHelper.Print(ms, request.PrinterName, "My printing job", true);
In addition, you could use the System.Drawing.Printing provided by .NET to do print with your printer and tell us your testing result. Please refer to the following code. I am looking forward to your feedback.
- Code: Select all
private void pdfPrint(string filePath)
{
PrintDocument pd = new PrintDocument();
Process p = new Process();
ProcessStartInfo startInfo = new ProcessStartInfo();
startInfo. CreateNoWindow = true;
startInfo. WindowStyle = ProcessWindowStyle.Hidden;
startInfo. UseShellExecute = true;
startInfo. FileName = filePath;
startInfo. Verb = "print";
startInfo. Arguments = @"/p /h \" + filePath + "\"\"" + pd.PrinterSettings.PrinterName + "\"";
p.StartInfo = startInfo;
p.Start();
p.WaitForExit();
}
private void button1_Click(object sender, EventArgs e)
{
string filePath = "input.pdf";
pdfPrint(filePath);
}
Sincerely,
Annika
E-iceblue support team
Login to view the files attached to this post.