This is an archived forum post. The information may be outdated. Contact us if you have any questions.

(C#) Pdfcrowd Error: 503 - Simultaneous API calls from a single IP are not allowed

tuanpa wrote on 2013-10-18:
I have just setup the URI to PDF API for ASP.Net-C# and it is most excellent. However, I am getting a 503 error, Simultaneous API calls from a single IP are not allowed. I don't want to be sending simultanious calls, just one. Could you look at the code below and tell me what I am doing wrong?
link URL:

string getURL = "";
string strfileName = "report";
System.Web.HttpResponse Response = System.Web.HttpContext.Current.Response;
// create an API client instance
pdfcrowd.Client client = new pdfcrowd.Client("xxx", "xxx");

// convert a web page and write the generated PDF to a memory stream
MemoryStream mstream = new MemoryStream();
client.convertURI(getURL, mstream);
// set HTTP response headers

Response.AddHeader("Content-Type", "application/pdf");
Response.AddHeader("Cache-Control", "no-cache");
Response.AddHeader("Accept-Ranges", "none");
Response.AddHeader("Content-Disposition", "attachment; filename=" + strfileName + ".pdf");
// send the generated PDF
catch (pdfcrowd.Error why)

Many Tks!
support wrote on 2013-10-18:

You need to restructure your code so that: - renders the HTML page - calls the API and returns PDF

It could look like this:
var ctx = HttpContext.Current;

if (Request.QueryString["pdf"]) {
    // your current code that calls the API
} else {
    // render the HTML page
tuanpa wrote on 2013-10-29:
Thank you for help me!