Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to print through .NET code from an Azure Worker Role

Tags:

c#

pdf

azure

To start off with, I am aware of this question that seems to ask the same thing. However I'm going to ask it again with a slight modification.

I'm working on a project to print PDF's. We have a library for PDF manipulation. We can use it to render a PDF to a file that the System.Drawing.Printing.PrintDocument object can use and print in c#. We are going to have an Azure Worker role that takes many 1-page pdf's and turns them into one large pdf, and I would like to have another Azure Worker Role that then spools that large PDF to a Windows Print Server here locally.

Since the printing part is so much slower (compared to the pdf creation/aggregation piece) I would like to be able to host it in azure to easily scale.

My initial thought was "I don't think this is even possible. How would Azure be able to know anything about my local print server." Which is the basic answer from the above similar question. But after some searching, I found some results that seem to indicate setting up a VPN Site-To-Site Tunnel or ExpressRoute Connection would let me do what I want. However I'm relatively new to Azure and the results I found are short on actual, useful, helpful details.

If it can't be done, fine, I can set up an application server locally to do the printing. But if someone has ideas or more insight on how to accomplish this I would love to hear it.

like image 659
pfunk Avatar asked Oct 07 '15 14:10

pfunk


1 Answers

Basically, you could store PDFs into Azure Blob Storage like:

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

Then you define an Azure Queue entity like:

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 to the Azure Queue.

Then on your Printing server, just setup an application to check the AzureQueue to process the PDFs. At this point, just get the PDFs directly from Azure blob storage url to do anything you want like merging, printing,....

like image 192
Minh Nguyen Avatar answered Sep 23 '22 04:09

Minh Nguyen