Can I print using .NET code from the Azure Worker role?

For starters, I know about this question, which seems to be asking the same thing . However, I will ask him again with slight modifications.

I am working on a project to print PDF files. We have a library for processing PDF. We can use it to render a PDF to a file that a System.Drawing.Printing.PrintDocument object can use and print in C #. We will have the Azure Worker role, which takes up many single-page PDF files and turns them into one large PDF file, and I would like to have another Azure Worker role, which then locally links this large PDF file to the Windows print server.

Since the print part is much slower (compared to the pdf creation / aggregation part), I would like to be able to place it in azure to easily scale.

My initial thought: “I don’t think it is possible. How can Azure learn anything about my local print server.” Which is the main answer to the above similar question. But after some searching, I found some results that seem to indicate that setting up a site-based VPN tunnel or ExpressRoute Connection will allow me to do what I want. However, I am relatively new to Azure, and the results I found do not match the actual, useful, and useful details.

If this is not possible, excellent, I can set up a local application server for printing. But if someone has ideas or a deeper understanding of how to do this, I would love to hear that.

+5
source share
2 answers

Basically, you can store PDF files in Azure Blob Storage , for example:

http://azureaccount.blob.core.windows.net/PDF/pdf1.pdf 

Then you define an Azure Queue object, for example:

MyQueue (Pdf_Id, Pdf_Blob_Url)

 MyQueue(1, http://azureaccount.blob.core.windows.net/PDF/pdf1.pdf) MyQueue(2, http://azureaccount.blob.core.windows.net/PDF/pdf2.pdf) 

and submit Azure Queue .

Then on the print server, just configure the application to check AzureQueue for processing PDF files. At this point, just get the PDF files directly from the Azure blob storage URL to do whatever you want, like merge, print, ...

+2
source

Without going into VPN / Site-To-Site settings, here is the idea:

You may have a small application hosted on your network that uses Service Bus Relay to provide WCF services (this will allow incoming connections to the service from the role)

The worker role can use this service and then send a PDF to print on it.

Your application will send the PDF to the printer using the PrintDocument object that you mentioned.

Cm:

https://azure.microsoft.com/en-gb/documentation/articles/service-bus-dotnet-how-to-use-relay/

What is a service bus relay? The service bus relay service allows you to create hybrid applications that run both in the Azure data center and your own enterprise environment. A service bus relay facilitates this by allowing you to safely expose Windows Communication Foundation Services (WCFs) that are on the corporate corporate network to the public cloud without opening a firewall, or require intrusive changes to the corporate network infrastructure.

+1
source

Source: https://habr.com/ru/post/1233173/


All Articles