0

I want to create PDF file by URL using ASPOSE.PDF and try the following code:

string dataDir =@"C:\Users\UbaidUllah\Documents\Visual Studio 2015\Projects\aspose\Data\AsposePDF\DocumentConversion\";
WebRequest request = WebRequest.Create("https://www.cricbuzz.com/cricket-stats/icc-rankings/men/batting");
request.Credentials = CredentialCache.DefaultCredentials;
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
Stream dataStream = response.GetResponseStream();
StreamReader reader = new StreamReader(dataStream);
string responseFromServer = reader.ReadToEnd();
reader.Close();
dataStream.Close();
response.Close();
MemoryStream stream = new MemoryStream(System.Text.Encoding.UTF8.GetBytes(responseFromServer));
HtmlLoadOptions options = new HtmlLoadOptions("https://www.cricbuzz.com/");
Document pdfDocument = new Document(stream, options);//----not execute this line nor give any error-----
pdfDocument.Save(dataDir + "WebPageToPDF_out.pdf");

When i debug this code, it does not go forward from the second last line(as described in comment) nor give any error, i wait much time but do not get any response.

I don't know where the mistake is. please review the code and help me to solve the issue.

Thank you very much!

Ubaid
  • 77
  • 10
  • 1
    This issue seems related to high memory consumption by the API and we encourage that you could please report it directly over Aspose.PDF Support Forum (https://forum.aspose.com/c/pdf) so that it can be logged and addressed accordingly. This is Asad Ali and I work as Developer Evangelist at Aspose Pty Ltd. – Asad Ali Sep 02 '20 at 00:24
  • Thank you @AsadAli , I reported it on ASPOSE Github issue center "https://github.com/aspose-free-consulting/projects/issues/72" but still no reposence! I also tried to connect with their technical team but I also received no response from them. Please can send me another link for creating a PDF file by URL using Aspose.Pdf? – Ubaid Sep 02 '20 at 03:57
  • We are responding to your query at the moment in the forums. We apologize for the delay and inconvenience. – Asad Ali Sep 02 '20 at 19:20

0 Answers0