Open large document file
Dear Syncfusion Team,
My Word document files have lots of graphic, images and text, each of size is 20mb and has 600 pages. I tried to open a file according to below codes.
string wordfilepath = @"D:\Testweb\documents\NSC\NSC_20210503_022113.docx";
using (FileStream fileStream = new FileStream(wordfilepath, System.IO.FileMode.Open, System.IO.FileAccess.Read))
{
WordDocument document = WordDocument.Load(fileStream, ImportFormatType.Docx);
string json = Newtonsoft.Json.JsonConvert.SerializeObject(document);
document.Dispose();
//To observe the memory go down, null out the reference of document variable.
document = null;
SfDocumentEditor editor = container.DocumentEditor;
editor.Open(json);
//To observe the memory go down, null out the reference of json variable.
json = null;
}
But while opening this file, consumption of memory is too high as well as file is not opened. So, How do I open those large files.
Thank you,
Deegii
SIGN IN To post a reply.
19 Replies
SM
Suriya Murugan
Syncfusion Team
May 4, 2021 12:41 PM UTC
Hi Deegii,
Syncfusion Greetings!
Can you increase maximum length and try importing document?
For processing the large size documents, we need to configure the MaximumReceiveMessageSize to higher value within ConfigureSerives .
Documentation: https://docs.microsoft.com/en-us/aspnet/core/signalr/configuration?view=aspnetcore-3.0&tabs=dotnet#configure-server-options
Please refer code example required for increasing the message size within ConfigureServices method in Startup.cs file.
|
// To increase the size of the buffer
services.AddServerSideBlazor().AddHubOptions(o =>
{
o.MaximumReceiveMessageSize = 102400000;
}); |
Kindly revert us if you still facing issues along with the document upon which you face issue.
Also, Can you please share the details of Blazor approach (Blazor server or Blazor webassembly mode) you are using?
Regards,
Suriya M.
DE
Deegii
May 4, 2021 12:57 PM UTC
Thank you for your response.
The followings are my codes but results is not comes out
services.AddServerSideBlazor(options =>
{
options.DisconnectedCircuitRetentionPeriod = TimeSpan.FromMinutes(20);
}).AddHubOptions(x => x.MaximumReceiveMessageSize = 1572864000);
services.AddSignalR(e => {
e.MaximumReceiveMessageSize = 1572864000;
});
.............................
WordDocument document = WordDocument.Load(fileStream, ImportFormatType.Docx);
string json = Newtonsoft.Json.JsonConvert.SerializeObject(document);
I saved json string of only one file into the database, its around 144Mb.
How do I open large files. Please give me some idea.
Thank you,
Deegii
SM
Suriya Murugan
Syncfusion Team
May 5, 2021 11:08 AM UTC
Hi Deegii,
As we mentioned earlier, can you please share your input document to check it in our side? that will be helpful for us to proceed further and provide you solution at earliest.
Note: If couldn’t upload large size document in forum, if possible, zip the document and send it to [email protected] mail box with the incident id as subject.
Regards,
Suriya M.
DE
Deegii
May 5, 2021 06:10 PM UTC
Dear Suriya Murugan,
Please see my attached file that i have prepared for your review.
Regards,
Deegii
Attachment: tusul_75be3bce.zip
SM
Suriya Murugan
Syncfusion Team
May 6, 2021 12:59 PM UTC
Hi Deegii,
Thanks for sharing the document.
Currently, we are checking the document and will update further details by May 10,2021.
Regards,
Suriya M.
KB
Kurthis Banu Abdul Majeeth
Syncfusion Team
July 25, 2021 04:25 PM UTC
Hi Deegii,
Sorry for the inconvenience caused.
We will check and update the further details on July 27,2021.
Regards,
Kurthis Banu A.
KB
Kurthis Banu Abdul Majeeth
Syncfusion Team
July 27, 2021 03:07 PM UTC
Hi Deegii,
We need an additional timeline to validate the root cause of this issue. We will check and update the further details on July 29,2021.
Regards,
Kurthis Banu A.
KB
Kurthis Banu Abdul Majeeth
Syncfusion Team
July 30, 2021 02:57 AM UTC
Hi Deegii,
We need some additional timeline to validate the reported issue. We will update further details by August 2,2021.
Regards,
Kurthis Banu A.
KB
Kurthis Banu Abdul Majeeth
Syncfusion Team
August 2, 2021 04:31 PM UTC
Hi Deegii,
From further validation, Docx file is zip archive file with extension as "docx" Document Editor internally decompresses it and populates the content in the document object and convert it to SFDT and shared to client side for rendering. In the shared document initial file size is 20 MB and the extracted size is 40 MB. We convert the 40 MB contents to the SFDT format expected by the client side. The generated SFDT is around 140 MB and which uses interop methods to pass the string to client side. Here when passing we are facing the disconnection from the interop methods. We are analyzing on the option available to use application level setting and it was not helpful yet. We are exploring if we can try any other alternatives in passing the string to the client. We will share the further analysis details by Aug 4th, 2021.
Regards,
Kurthis Banu A.
KB
Kurthis Banu Abdul Majeeth
Syncfusion Team
August 5, 2021 03:31 AM UTC
Hi Deegii,
From further validation, Docx file is zip archive file with extension as "docx" Document Editor internally decompresses it and populates the content in the document object and convert it to SFDT and shared to client side for rendering. In the shared document initial file size is 20 MB and the extracted size is 40 MB. We convert the 40 MB contents to the SFDT format expected by the client side. The generated SFDT is around 140 MB and which uses interop methods to pass the string to client side. Here when passing we are facing the disconnection from the interop methods. We are analyzing on the option available to use application level setting and it was not helpful yet. We are exploring if we can try any other alternatives in passing the string to the client.
We will update further details on August 5,2021
Regards,
Kurthis Banu A.
KB
Kurthis Banu Abdul Majeeth
Syncfusion Team
August 6, 2021 03:27 AM UTC
Hi Deegii,
We are facing some difficulty to validate the root cause of the reported issue. We need some additional timeline to validate further. We will update further details by August 9,2021.
Regards,
Kurthis Banu A.
KB
Kurthis Banu Abdul Majeeth
Syncfusion Team
August 10, 2021 03:46 AM UTC
Hi Deegii,
We have confirmed the reported issue as bug and logged the defect report. We will fix this issue and include in our Blazor Nuget release which scheduled on September 8,2021.
You can track the status of bug through below feedback link:
Regards,
Kurthis Banu A.
KB
Kurthis Banu Abdul Majeeth
Syncfusion Team
September 8, 2021 02:13 PM UTC
Hi Deegii,
We deeply regret the inconvenience caused.
We are not possible to include the fix in our latest patch release. Currently, we are working on resolving this issue with high priority. We will fix this issue and include in our Blazor Nuget release which scheduled on October 5,2021.
You can track the status of bug through below feedback link:
Regards,
Kurthis Banu A.
KB
Kurthis Banu Abdul Majeeth
Syncfusion Team
October 5, 2021 01:32 PM UTC
Hi Deegii,
We deeply regret the inconvenience caused.
We are not possible to include the fix in our latest patch release. Currently, we are working on resolving this issue with high priority. We will fix this issue and include in our patch release which scheduled on October 12, 2021.
You can track the status of bug through below feedback link:
Regards,
Kurthis Banu A
KB
Kurthis Banu Abdul Majeeth
Syncfusion Team
October 13, 2021 03:40 PM UTC
Hi Deegii,
We deeply regret the inconvenience caused.
We are not possible to include the fix in our latest patch release. We are facing complexity in transferring the image bytes present in the document from server to client. We will fix this issue and include in our EJ2 patch release which scheduled on October 20, 2021.
You can track the status of bug through below feedback link:
Regards,
Kurthis Banu A.
SM
Suriya Murugan
Syncfusion Team
February 3, 2022 10:39 AM UTC
Hi Deegii ,
Apologies!
We are unable to include the fix as promised. We will include it in our next EJ2 patch release which scheduled for February 9,2022.
You can track the status of bug through below feedback link:
Regards,
Suriya M.
SM
Suriya Murugan
Syncfusion Team
February 10, 2022 03:18 AM UTC
Hi Deegii,
We will update details shortly.
Regards,
Suriya M.
SM
Suriya Murugan
Syncfusion Team
February 11, 2022 04:12 AM UTC
Hi Deegii,
We are glad to announce that our patch release (v19.4.50) is rolled out successfully and In this release, we have added the fix for the reported issue.
Please upgrade to the latest version packages to resolve this issue.
Startup.cs increase memory by using below lines:
|
builder.Services.AddServerSideBlazor().AddHubOptions(o =>
{ o.MaximumReceiveMessageSize = 1572864000; }); builder.Services.AddSignalR(e => {
e.MaximumReceiveMessageSize = 1572864000; }); |
Please let us know if you need any further assistance.
Regards,
Suriya M.
DE
Deegii
April 2, 2022 02:42 PM UTC
Thank you very much,
Deegii
SIGN IN To post a reply.
- 19 Replies
- 3 Participants
-
DE Deegii
- May 3, 2021 05:16 PM UTC
- Apr 2, 2022 02:42 PM UTC