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.

Thu Feb 08, 2018 5:06 pm

Ok, so i have the need to make sure that the print is sent and after the print is sent, to move the PDF, here is my code for printing:

Code: Select all
  internal static void SendToPrinter(string pdf)
        {
            PdfDocument doc = new PdfDocument();
            doc.LoadFromFile(pdf);
            doc.Print();
            doc.Close();
            doc.Dispose();
        }


Now, the question is, once i do the doc.Print() does this spawn a new thread to send to the printer or is it in the same thread, i need to know this because directly after this is completed to send the job to the printer queue, i need to move the actual file to a different folder so i know that document has been printed. I know i can't move a file that is in use and i have created PDF print queues for my documents.

Thanks

JonathanWood
 
Posts: 26
Joined: Fri Feb 26, 2016 2:19 am

Fri Feb 09, 2018 2:20 am

Hello,

Thanks for your inquiry.
The method doc.Print() is in a new thread, after printing is completed, you could move your actual file to other different folders. If there is any question, welcome to write back.

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Tue Feb 13, 2018 9:33 am

Hello,

Greetings from E-iceblue.
Did we resolve your issue?
Thanks in advance for your valuable feedback and time.

Best wishes,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Tue Jul 23, 2019 2:16 pm

This method basically creates a "print" thread that I have no idea of its state so I have resolved to move to another product for the project this issue was on, and have 2 new threads with issues on that new project I am on, but this issue can remain an issue unless someone else needs it resolved. FYI the best solution here is to use a printer hot folder and use a different product to perform the print task and not Spire.PDF to actually send the print job to a printer. Using Fiery hot folders was the solution and using the Fiery workflows for handling the resulting PDF was the solution.

JonathanWood
 
Posts: 26
Joined: Fri Feb 26, 2016 2:19 am

Wed Jul 24, 2019 3:18 am

Hi,

Thank you for sharing your solution.
Wish you a nice day!

Sincerely,
Nina
E-iceblue support team
User avatar

Nina.Tang
 
Posts: 1187
Joined: Tue Sep 27, 2016 1:06 am

Return to Spire.PDF