We are sorry to hear that you have such issue. To be able to convert content which you get from URL to the pdf document you should save this content as an HTML file and then convert this file to the pdf.
Please check this ready to use (just change sample URL and file name to your data) code example:
// We will store the html response of the request here
string siteContent = string.Empty;
// The url you want to grab
string url = “put your url in here”;
// Here we’re creating our request, we haven’t actually sent the request to the site yet…
// we’re simply building our HTTP request to shoot off to google…
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.AutomaticDecompression = DecompressionMethods.GZip;
// Wrap everything that can be disposed in using blocks…
// They dispose of objects and prevent them from lying around in memory…
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) // Go query google
using (Stream responseStream = response.GetResponseStream()) // Load the response stream
using (StreamReader streamReader = new StreamReader(responseStream)) // Load the stream reader to read the response
{
siteContent = streamReader.ReadToEnd(); // Read the entire response and store it in the siteContent variable
}
// Write the stream contents to a new file named “AllTxtFiles.txt”.
StreamWriter outfile = new StreamWriter(Server.MapPath(@“App_Data/test1.html”));
outfile.Write(siteContent);
var conversion = GroupdocsConversion.Instance();
// prepare desired output file name with Path
var outputFile = “converted\SampleConverted.pdf”;
// converting and downloading result
var convertResult = conversion.Convert(“test1.html”, outputFile, FileType.Pdf);
if (convertResult.State == ConversionState.Completed)
{
Download(convertResult.ConvertedFileName);
}
else
{
if (convertResult.State == ConversionState.Failed)
{
ClientScript.RegisterStartupScript(GetType(),“errorMessage”,“alert(‘Conversion failed: “+convertResult.ErrorMessage+”’);”,true);
}
}
As you can see from this code we get web content of the URL via StreamReader then save it’s content as a html file and simply use this html file for conversion.