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.

Sat Sep 18, 2021 6:38 am

Hello surendrak,

Thanks for your inquiry.

I tested your code to print multiple copies to a real printer (HP LaserJet P1007) with the latest Spire.PDF Pack(Hot Fix) Version:7.9.2, but it worked well. To help us further investigate your issue, please provide the following information.
1) Your project type, such as Console Application (.NET Framework 4.5)
2) Your printer name.
3) The OS information, e.g. Windows 7, 64 bit.
4) Do you encounter the same issue when printing three copies in Adobe using your printer?

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Mon Sep 27, 2021 2:18 am

Hello surendrak,

Greetings from E-iceblue!
How is your issue now? Could you please give us some feedback at your convenience?

Sincerely,
Brian
E-iceblue support team
User avatar

Brian.Li
 
Posts: 1271
Joined: Mon Oct 19, 2020 3:04 am

Mon Feb 07, 2022 3:12 pm

Hello,

was there ever a solution for this ? I have the very same problem.

I use the free version in PowerShell Core, but plan to later use it in c#.

This is the code so far:

Code: Select all
# print pdf with Spire.PDF
Add-Type -Path D:\Spire.Pdf.dll
$v = new-object Spire.Pdf.PdfDocument
$v.LoadFromFile("d:\xyz.pdf")
$v.PrintSettings.DocumentName = "Hello World"
$v.PrintSettings.Color = $true
$v.PrintSettings.Copies = 5
$v.PrintSettings.Duplex = [System.Drawing.Printing.Duplex]::Simplex
$v.PrintSettings.PrinterName = "FinePrint"
$v.Print()


Regardless of what I enter at "Copies" there is always only one copy printed.

The same is the case when I use a hardware printer.
I tried to download the linked c# projects but they seem to be unavailable.

Henry_Jones
 
Posts: 3
Joined: Mon Feb 07, 2022 2:58 pm

Tue Feb 08, 2022 7:03 am

Hello,

Thanks for your inquiry!

I tested the code you provided with the PowerShell 7.2.1 and the dll from the netcoreapp3.0 folder of the latest Spire.PDF Free version 7.8.9, but did not reproduce your issue. If you were not using the same dlll, I just recommend that you can try the dll as I mentioned. If the issue still exist, please provide us with your system information (E.g. Win7, 64 bit) for reference.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Fri Feb 11, 2022 8:46 am

This is quite surprising. I took the two files (spire.pdf.dll and spire.license.dll) from the net5.0 folder, as there is no "netcoreapp3.0" folder in the nuget package. The result remains the same.

I also tried it with the new version 8.2, and took the files from "net6.0" folder, as there is neither a "net5.0" nor a "netcoreapp3.0" folder. Also there is no change, still only one page is sent to the "FinePrint" printer.

After some more tries, maybe I'm closer to the source of the problem. It is more or less a display issue. An example: a document with two pages and multiple copies will still be shown as two pages in "FinePrint" but correctly printed multiple times on a "real" printer (but at least on our Xerox machines will still show only as 2 pages). If "sorted" is set in Acrobat Reader, FinePrint will show 6 pages (with Copies=3).

I guess that "Collate" is the same option as "sorted" in Spire.Pdf but the "real" printout of the two page document is the same with the value set to "true" or "false". Propably the Duplex option also enters into the mix here. Either way, it shows in FinePrint and the Xerox machines as a two page document, so there might still be another problem in the spire component.

FinePrint seems to be ignoring the copies value, if the printout results in same pages following each other.

To cut it short: for our use, it is important to have the correct copies printed, which seems to be the case, despite wrong display in some places.

Henry_Jones
 
Posts: 3
Joined: Mon Feb 07, 2022 2:58 pm

Fri Feb 11, 2022 10:00 am

Hello,

Thanks for your feedback!

I also tested printing with the dll under NET5.0 folder, but still did not reproduce the issue, here I attached the code I used.
Code: Select all
# print pdf with Spire.PDF
Add-Type -Path C:\Users\admin\Desktop\spire.pdf-fe_8.2.2\BIN\NET5.0\Spire.Pdf.dll
$v = new-object Spire.Pdf.PdfDocument
$v.LoadFromFile("E:\xyz.pdf")
$v.PrintSettings.DocumentName = "Hello World"
$v.PrintSettings.Color = $true
$v.PrintSettings.Copies = 5
$v.PrintSettings.Duplex = [System.Drawing.Printing.Duplex]::Simplex
$v.PrintSettings.PrinterName = "Microsoft Print to PDF"
$v.Print()


Is the "FinePrint" or the "Xerox" a kind of XPS printer? Kindly note that even open the PDF in Adobe and print it to XPS via Adobe with 5 copies, the generated XPS file also only contains one page, and our product get the same result as Adobe. If not, please provide us with the detail information of your printer. Thanks in advance.

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Fri Feb 11, 2022 11:58 am

Hello,

the FinePrint driver is a kind of virtual printer, to collect multiple printouts to be printed on one page or create a booklet. --> fineprint.com. I guess it qualifies as a "kind of XPS printer". I was only using it for testing, to save paper. But obviously this was not the best idea to begin with.

With a single page document the outcome is always the same (one page independent of copies value in Spire.PDF). With a two page document, the outcome with Spire.PDF is also always a two page document (independent of the "Collate" setting). With Acrobat Reader the outcome depends on the "sorted" setting, if set, the result count is 2*copies, without only 2 pages.

The printout to "Microsoft Print to PDF" always result in 2*copies pages, so the "Collate" or "sorted" setting makes no difference. It does not make a difference in page order either, which seems illogical, but this does not matter much.

So there is a small difference between the two ways to print, but as said before, the goal is not to print to "FinePrint" but to a real printer and there everythings seems to work, even without the correct display of printed pages.

The "Xerox" is a type of business printer, --> office.xerox.com/en-us/multifunction-printers/altalink-c8000-series, maybe their printer driver is smart enough to only transfer the pages once and handle the copies value internal, without displaying them properly in the printer status display.

With this knowledge I can continue with integration of the component.

Thank you for your prompt support and help.

Henry_Jones
 
Posts: 3
Joined: Mon Feb 07, 2022 2:58 pm

Mon Feb 14, 2022 5:33 am

Hello,

Thanks for your feedback and sharing us with your investigate.

If you encounter any issues related to our product in the future, just feel free to contact us.

Have a nice day!

Sincerely,
Marcia
E-iceblue support team
User avatar

Marcia.Zhou
 
Posts: 858
Joined: Wed Nov 04, 2020 2:29 am

Return to Spire.PDF