Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Sun Apr 26, 2015 11:59 pm

Hi,

I am trying to use this code in asp.net, but the process seems to be running forever.
Do you know if this can work in asp.net or winforms only ?

Thanks,

Code: Select all
PdfDocument doc = new PdfDocument();
String url = "http://www.google.com/";
Thread thread = new Thread(() =>
{
doc.LoadFromHTML(url, false, true, true);
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();
doc.SaveToFile("result.pdf");
doc.Close();

awardhan
 
Posts: 3
Joined: Sun Sep 28, 2014 11:29 pm

Mon Apr 27, 2015 3:06 am

Hello,

Thanks for your inquiry.
Our products can work well in asp.net.
Please change the code:
Code: Select all
doc.SaveToFile("result.pdf");

to the code below:
Code: Select all
doc.SaveToHttpResponse("result.pdf",Response,HttpReadType.Save);

If there are any questions, welcome to get it back to us.

Sincerely,
Sweety

E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Mon Apr 27, 2015 7:35 am

Yes, the product works well in asp.net

Thanks for your help.

awardhan
 
Posts: 3
Joined: Sun Sep 28, 2014 11:29 pm

Tue Apr 28, 2015 1:41 am

Hello,

Please feel free to contact us, if you have any questions or needs. We are here for help.

Sincerely,
Sweety

E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Tue Apr 28, 2015 6:46 am

Hi again,

I bumped into another problem with LoadFromHtml when I deployed in windows Azure VM.
It seems to crash the application and stopping the application pool for that site.

Do you have any idea why ?
Also, is there minimum memory requirements to run this operation ? It seems to consume quite a fair bit of memory.

EDITED
It was actually the cpu usage went high, but we are not sure if that's the one that cause the problem.
Everytime I run the code, the process crash the application pool in Azure but works in local workstation.

Any suggestion would be great,

Thank you,
Aditya

awardhan
 
Posts: 3
Joined: Sun Sep 28, 2014 11:29 pm

Wed Apr 29, 2015 8:20 am

Hello,

Thanks for your inquiry.
This operation has no memory limit. Is there any exception information? Could you please give us some screenshots?
And could you convert a small Html page on windows Azure VM? To see if it can be converted successfully.

Sincerely,
Sweety

E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Tue May 05, 2015 9:06 am

Hello,

Has your issue been resolved? Thanks for your feedback.

Thanks,
Sweety

E-iceblue support team
User avatar

sweety1
 
Posts: 539
Joined: Wed Mar 11, 2015 1:14 am

Return to Spire.PDF