Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Fri Nov 03, 2017 12:23 pm

Hello,
image color disappear when i print silently. I use latest Spire.pdf 3.9.431 and this is my code:
Code: Select all
PdfDocument doc = new PdfDocument();
doc.LoadFromFile(path);
doc.PrintSettings.PrinterName = "PRINTER A3";
doc.PrintSettings.Copies = (short)2;

PaperSize paper = new PaperSize("A3", PdfPageSize.A3.Width, PdfPageSize.A3.Height);
paper.RawKind = (int)PaperKind.A3;
doc.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.FitSize, true, 100f);
doc.Print();


For attachment there is the file that i use.
Thanks

Degiorgi
 
Posts: 17
Joined: Thu Nov 02, 2017 3:22 pm

Mon Nov 06, 2017 2:33 am

Hello,

Thanks for your post. After an initial test, I was unable to reproduce the issue on my side. Hence, please check if your printer supports color.
https://msdn.microsoft.com/en-us/library/system.drawing.printing.pagesettings.color(v=vs.110).aspx

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Mon Nov 06, 2017 9:02 am

Hello,
my printer supports color, in fact i correctly see text color but images are in black and white and also I have a problem printing file with color gradient.
In attachment a file with gradient, thanks in advance.
Mauro

Degiorgi
 
Posts: 17
Joined: Thu Nov 02, 2017 3:22 pm

Mon Nov 06, 2017 9:55 am

Hello Mauro,

Thanks for your feedback. I have noticed the gradient color issue and logged it in our bug tracking system. If there is any update, we will inform you.
Regarding the issue of image color lost, do you only encounter it when using a real printer? How about a virtual printer? Such as Microsoft XPS Document Writer.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Mon Nov 06, 2017 2:15 pm

Hello, i tried to print with a virtual printer by setting:

Code: Select all
doc.PrintSettings.PrinterName = "Microsoft XPS Document Writer";


but it doesn't work.
Can you provide me a code example to print by a virtual printer?

Printing by default system dialog my file is printed correctly in real printer and into XPS Document Writer.
Thanks in advance

Degiorgi
 
Posts: 17
Joined: Thu Nov 02, 2017 3:22 pm

Tue Nov 07, 2017 6:24 am

Hello Mauro,

Thanks for your reply. Your code is correct. To help us investigate further, please share us with the following information.
1. OS information of your machine, such as Win7 64bit
2. Region and Language setting of your machine, such as Chinese(China)
3. The result XPS file that printed by default system dialog
Below is the code snippet that work on my side. Also attached the XPS file printed on my side.
Code: Select all
            PdfDocument doc = new PdfDocument();
            doc.LoadFromFile(@"557.pdf");
            doc.PrintSettings.PrinterName = "Microsoft XPS Document Writer";
            doc.PrintSettings.Copies = (short)2;
            PaperSize paper = new PaperSize("A3", (int)PdfPageSize.A3.Width, (int)PdfPageSize.A3.Height);
            paper.RawKind = (int)PaperKind.A3;
            doc.PrintSettings.SelectSinglePageLayout(PdfSinglePageScalingMode.FitSize, true, 100f);
            doc.Print();


Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Mon Nov 13, 2017 1:41 pm

Hello,
thanks for your replay.
Below the information required:
- Windows 7 Ultimate 64 bit
- Italiano (Italia)
- In attachment xps file printed and one photo of file printed.

I tried your code in a simple console application and it works fine, I see in output tha same xps file.
But, with the same code, printing on a phisical printer i see the image in black and white.
In attachment xps file printed and one photo of file printed.
Thanks in advance.

Degiorgi
 
Posts: 17
Joined: Thu Nov 02, 2017 3:22 pm

Tue Nov 14, 2017 4:41 am

Hello Mauro,

Thanks for your information. Please tell us which model of your A3 printer you are using.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Tue Nov 14, 2017 6:02 am

Hello,

Please try to directly print the image with the following codes using your printer, and then get the result back to us. Thanks for your cooperation.
Code: Select all
using System.Drawing;
using System.Drawing.Printing;
 private void button2_Click(object sender, EventArgs e)
        {
            PrintDocument pd = new PrintDocument();
            pd.PrintPage += PicturePrintDocument_PrintPage;
            pd.PrinterSettings.PrinterName = "printer name";
            pd.Print();
        }
 private void PicturePrintDocument_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawImage(Image.FromFile("1.png"), 0, 0); 
            e.HasMorePages = false;
        }

Sincerely,
Gary
E-iceblue support tea
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Nov 14, 2017 9:57 am

Hello,
it always is in black white.
In attachment the result, thanks you.

Degiorgi
 
Posts: 17
Joined: Thu Nov 02, 2017 3:22 pm

Wed Nov 15, 2017 6:58 am

Hello,

Thanks for your feedback. On the other hand, would you please provide us with the model information of your printer? Thanks a lot.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Wed Nov 15, 2017 8:47 am

Hello,
thanks a lot to you.
This is the model of my printer: bizhub C224e - KONICA MINOLTA

Degiorgi
 
Posts: 17
Joined: Thu Nov 02, 2017 3:22 pm

Thu Nov 16, 2017 10:05 am

Hello,

Thanks for your sharing. We will investigate the issue further. If there is any update, we will let you know.

Best regards,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Fri Nov 17, 2017 9:11 am

Hello,

Thanks for your waiting. After investigation further, we found that the image in the pdf document uses the DeviceGray colorspace, we suppose it might be the reason, did you try to print it directly with your printer in adobe?
In addition, I also add a image with DeviceRGB colorspace into the attached pdf document, please try to print it via our product with your printer, and then get the result back to us. Thanks for your cooperation.
Also, the gradient color issue has get resolved in the latest hotfix(Spire.PDF Pack(Hot Fix) Version:3.9.462), you could download it from the following link.
https://www.e-iceblue.com/Download/down ... t-now.html

Sincerely,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Nov 21, 2017 8:00 am

Hello,

Greeting from E-iceblue.
How are the issues going? Has the hotfix resolved the gradient color issue?
Your feedback will be greatly appreciated.

Sincerely,
Simon
E-iceblue support team
User avatar

Simon.yang
 
Posts: 620
Joined: Wed Jan 11, 2017 2:03 am

Return to Spire.PDF

cron