It is expecting PDF contents in return from server. Even if your return type is empty.
You can put a pdf file on server and simply use Page.Response.Redirect("success.pdf");
If you are using C# then following MemoryStream can be return
private MemoryStream CreatePDFStream(string text)
{
var pdfMemoryStream = new MemoryStream();
try
{
//Create new PDF runtime OR read a saved PDF from server.
Document document = new Document();
PdfWriter.GetInstance(document, pdfMemoryStream)
.CloseStream = false;
document.Open();
document.Add(new Paragraph(text));
document.Close();
byte[] byteInfo = pdfMemoryStream.ToArray();
pdfMemoryStream.Write(byteInfo, 0, byteInfo.Length);
pdfMemoryStream.Position = 0;
if (WebOperationContext.Current != null)
{
WebOperationContext.Current.OutgoingResponse.ContentType = "application/pdf";
}
return pdfMemoryStream;
}
catch (Exception ex)
{
return pdfMemoryStream;
}
}