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.

Tue Aug 26, 2014 4:43 am

Hi Sir :

I am converting large means near about 20 MB of html into PDF.
It gets stuck on LoadFromHTML method of class Spire.Pdf.PdfDocument and the throws OutOfMemory exception.
Can you please suggest any solution or library not support that much amount of data?



Thanks,
Shailesh

shaileshggg
 
Posts: 34
Joined: Thu Aug 14, 2014 3:51 am

Tue Aug 26, 2014 6:16 am

Hello,

Thanks for your feedback.
One html file, or many html files? If one, could you please provide it to us for testing? And how much memory does your system have?
Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Thu Aug 28, 2014 9:38 am

Hello,

How is the issue now? If not, could you please provide us previous information? It would be helpful to investigate the issue.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Mon Sep 01, 2014 10:47 am

Hello :

We will send you sample within few minutes.
Till we have other question.
I dont know whether we should ask this on same forum or new one.
We are calling methods of this library in Backgroundworker thread and problem is PDFDocument.LoadFromHTML method internally calls WebBrowser control , it thows exception :
"ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment.".
What is the solution for this?


Thanks,
Shailesh

shaileshggg
 
Posts: 34
Joined: Thu Aug 14, 2014 3:51 am

Tue Sep 02, 2014 1:47 am

Hello,
Please use the single thread.
Code: Select all
Thread thread = new Thread(() =>
 {
doc.LoadFromHTML("test.html", true, true, false, setting);
});
thread.SetApartmentState(ApartmentState.STA);
thread.Start();
thread.Join();

Please don't hesitate to contact us for further problems.

Best regards,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Sep 02, 2014 4:24 am

Hi :

Still its giving error.
You mean we need to call this function on main thread itself without invoking backgroundworker?


Thanks,
Shailesh

shaileshggg
 
Posts: 34
Joined: Thu Aug 14, 2014 3:51 am

Tue Sep 02, 2014 5:02 am

Hi :

Actually we are creating a wrapper for the HTML to PDF conversion and we are calling it through a BackgroundWorker.
If we are unable to call this function using BackgroundWorker, then it may be problematic for us & then this library not useful for us.
Is there any solution for this?


Thanks,
Shailesh

shaileshggg
 
Posts: 34
Joined: Thu Aug 14, 2014 3:51 am

Tue Sep 02, 2014 6:28 am

Hello,

Thanks for your quick reply.
You only need to call this function in a single thread, may not be the main thread.
Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Sep 02, 2014 8:03 am

HI :

Yes, issue solved using single thread, Thanks.
I have tried to attach large html but mail doesnt get send.
Attachment file size is about 11 MB.
How Can I send file?


Thanks,
Shailesh

shaileshggg
 
Posts: 34
Joined: Thu Aug 14, 2014 3:51 am

Tue Sep 02, 2014 8:09 am

Hello,

Glad to hear that. You could send the file to our support email(support@e-iceblue.com);

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Sep 02, 2014 8:57 am

Hi :

I have sent mail to your id.
Can you please check?


Thanks,
Shailesh

shaileshggg
 
Posts: 34
Joined: Thu Aug 14, 2014 3:51 am

Tue Sep 02, 2014 9:34 am

Hello,

Sorry that we have not received it. Please send it again or provide us a download link for the file.

Thanks,
Gary
E-iceblue support team
User avatar

Gary.zhang
 
Posts: 1380
Joined: Thu Apr 04, 2013 1:30 am

Tue Sep 02, 2014 9:37 am

OK, we will send you a link within few minutes.

shaileshggg
 
Posts: 34
Joined: Thu Aug 14, 2014 3:51 am

Tue Sep 02, 2014 9:44 am

Please check :

www.page-monitor.com/Downloads/mail2.html


Thanks,
Shailesh

shaileshggg
 
Posts: 34
Joined: Thu Aug 14, 2014 3:51 am

Wed Sep 03, 2014 3:01 am

Hi :

Have you got file?
Any updates?



Thanks,
Shailesh

shaileshggg
 
Posts: 34
Joined: Thu Aug 14, 2014 3:51 am

Return to Spire.PDF