Server-backed pdf viewer 30Mb PDF Limit

Hitting 30Mb limit when using syncfusion/pdfviewer-server to back our React PdfViewerComponent with a serviceUrl.  How do we increase the limit? Is there a work around?

We attempted to bump Kestrel’s max request body to 1 GiB with an ENV  ASPNETCORE_Kestrel__Limits__MaxRequestBodySize=1073741824

"Env": [
            "SYNCFUSION_LICENSE_KEY=****/",
            "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin",
            "APP_UID=1654",
            "ASPNETCORE_HTTP_PORTS=80",
            "DOTNET_RUNNING_IN_CONTAINER=true",
            "DOTNET_VERSION=8.0.12",
            "ASPNET_VERSION=8.0.12",
            "DOCUMENT_SLIDING_EXPIRATION_TIME=10",
            "REDIS_CACHE_CONNECTION_STRING=",
            "DOCUMENT_PATH=",
            "ASPNETCORE_Kestrel__Limits__MaxRequestBodySize=1073741824",
            "ASPNETCORE_FormOptions__MultipartBodyLengthLimit=1073741824"

        ],


But still get 

2025-04-29 08:51:50      Connection id "0HNC6KT1J9LH7", Request id "0HNC6KT1J9LH7:00000002": An unhandled exception was thrown by the application.
2025-04-29 08:51:50      Microsoft.AspNetCore.Server.Kestrel.Core.BadHttpRequestException: Request body too large. The max request body size is 30000000 bytes.
2025-04-29 08:51:50          at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1ContentLengthMessageBody.OnReadStarting()
2025-04-29 08:51:50          at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.MessageBody.TryStartAsync()
2025-04-29 08:51:50          at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.Http1ContentLengthMessageBody.ReadAsyncInternal(CancellationToken cancellationToken)
2025-04-29 08:51:50          at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpRequestStream.ReadAsyncInternal(Memory`1 destination, CancellationToken cancellationToken)
2025-04-29 08:51:50          at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token)
2025-04-29 08:51:50          at Microsoft.AspNetCore.WebUtilities.FileBufferingReadStream.ReadAsync(Memory`1 buffer, CancellationToken cancellationToken)
2025-04-29 08:51:50          at Microsoft.AspNetCore.WebUtilities.StreamHelperExtensions.DrainAsync(Stream stream, ArrayPool`1 bytePool, Nullable`1 limit, CancellationToken cancellationToken)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Mvc.Formatters.NewtonsoftJsonInputFormatter.ReadRequestBodyAsync(InputFormatterContext context, Encoding encoding)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Mvc.ModelBinding.Binders.BodyModelBinder.BindModelAsync(ModelBindingContext bindingContext)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Mvc.ModelBinding.ParameterBinder.BindModelAsync(ActionContext actionContext, IModelBinder modelBinder, IValueProvider valueProvider, ParameterDescriptor parameter, ModelMetadata metadata, Object value, Object container)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Mvc.Controllers.ControllerBinderDelegateProvider.<>c__DisplayClass0_0.<<CreateBinderDelegate>g__Bind|0>d.MoveNext()
2025-04-29 08:51:50      --- End of stack trace from previous location ---
2025-04-29 08:51:50          at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextResourceFilter>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Rethrow(ResourceExecutedContextSealed context)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.InvokeFilterPipelineAsync()
2025-04-29 08:51:50      --- End of stack trace from previous location ---
2025-04-29 08:51:50          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeAsync>g__Logged|17_1(ResourceInvoker invoker)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Routing.EndpointMiddleware.<Invoke>g__AwaitRequestTask|7_0(Endpoint endpoint, Task requestTask, ILogger logger)
2025-04-29 08:51:50          at Microsoft.AspNetCore.ResponseCompression.ResponseCompressionMiddleware.InvokeCore(HttpContext context)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Authorization.AuthorizationMiddleware.Invoke(HttpContext context)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Authentication.AuthenticationMiddleware.Invoke(HttpContext context)
2025-04-29 08:51:50          at Microsoft.AspNetCore.Server.Kestrel.Core.Internal.Http.HttpProtocol.ProcessRequests[TContext](IHttpApplicati


2 Replies

VS Venkada Subramanian Durai Syncfusion Team April 29, 2025 03:52 PM UTC

Hi Raph Goldsworthy,

We are checking on the reported query and will provide further details by May 2, 2025


Regards,
Venkada Subramanian Durai



VS Venkada Subramanian Durai Syncfusion Team April 30, 2025 03:32 PM UTC

Hi Raph Goldsworthy,


We have increased the file size limit on the server side and prepared a Docker image with changes that allows you to load larger PDF documents in the PDF Viewer.

These changes will be included in the public Docker image as part of the Volume 1 SP 2025 release.

Please follow the steps below to run the provided Docker image:

1. Download and extract the provided Docker image archive.

2. Open a command prompt or terminal and execute the following steps:

○ Load the Docker image: docker load -i <filename>.tar

○ Verify the image is loaded: docker images

○ Run the Docker container: docker run -d -p 6006:80 <image_id>

Docker Images


Additionally, could you please confirm the purpose for which you are using server rendering mode? By using standalone rendering mode, you can use the PDF Viewer without the need for a server, which also improves performance.

If there are specific actions you need to perform that require server rendering mode, please let us know. We will provide solutions to achieve the same results in standalone mode.


Regards,

Venkada Subramanian D



Loader.
Up arrow icon