Facing MaxRetryError When Converting Word Documents Over 100MB to PDF

Hello,

I’m currently involved in a project that requires converting large Word documents (over 100MB) into PDF format using Aspose. For most files under 50MB, the conversion process works fine. However, for documents larger than 100MB, I consistently encounter a “ReadTimeoutError” and a “MaxRetryError”. Here is the specific code snippet I use for conversion:

with open(doc_path, 'rb') as doc:
    # Create a ConvertDocumentRequest object for PDF conversion
    request = awc.models.requests.ConvertDocumentRequest(document=doc, format='pdf')
    # Call the convert_document method
    convert_response = words_api.convert_document(request)

Where words_api represents an instance of WordsApi.

Given the size of the documents I need to handle, resolving this issue is critical. I’m reaching out with a few questions:

  1. Error Management: Can anything be adjusted or configured differently to prevent the “MaxRetries” error during the conversion process? If there’s a specific setting or workaround, I would appreciate guidance on how to implement it.
  2. Conversion Method: Is the approach I’m using (via convert_document(request)) the optimal method for handling large DOCX to PDF conversions with Aspose, or might there be a more effective alternative? Such as the Async method in SlidesAPI.

I’m seeking any advice, tips, or documentation that could help navigate or resolve this challenge. My goal is to ensure a smooth conversion process for large Word documents into PDF format without encountering the “MaxRetryError”.

Many thanks in advance for your support and guidance!

@MadzMoon

The document parsing is an initial step for every request. The larger the document, the longer the parsing time. In this case, it’s advisable to increase the timeout value. You can set the request timeout using configuration.Timeout, which is currently set to 100 seconds by default. Please adjust it as needed. Hopefully, it will resolve the issue.