When converted to a PDF file, the following code will always block, neither error nor execution

(1) Problem 1: When converting a large TXT file (about 30M) to a PDF file, the following code will always block, neither error, nor execution, and it will last about a day or so.

Attempts were made to throw a timeout exception and create a thread kill task, but since doc = awords.Document(self.file_path) should be an IO operation, both are invalid, still blocking, no execution and no error.

doc = awords.Document(self.file_path)

doc.save(self.save_path, awords.SaveFormat.PDF)

(2) Problem 2: When the PPT file is converted to PDF, some files are successfully converted, but some files will report errors (as follows)

presentation.save(self.save_path, aslides.export.SaveFormat.PDF)

RuntimeError: Proxy error(ArgumentException): Parameter is not valid.

@Maggieee,
Thank you for contacting free support.

We are sorry that you encountered these problems. We need more details to investigate the cases you described. Please share the following additional files and information:

  • sample text, Word, and PowerPoint files
  • OS version on which the code examples were executed
  • versions of Aspose.Words and Aspose.Slides you used

Dear :

Please refer to the attachment for the problem document.

新建文件夹.zip (2.5 MB)

@Maggieee,
Thank you for the sample files. With Aspose.Slides for Python 24.12, I could not reproduce the error you described. We recommend that you use the latest version.

As for converting the text file to a PDF document, my colleagues from Aspose.Words team will help you shortly.
@alexey.noskov FYI

@Maggieee Thank you for additional information. I cannot reproduce the problem on my side using the following simple code and the latest 24.12 version of Aspose.Words for Python:

doc = aw.Document("C:\\Temp\\in.txt")
doc.save("C:\\Temp\\out.pdf")

it takes about 1.5 minutes to convert the document to PDF. There are 12039 pages in the output file.
You can make conversion even faster if increase page size. the following code takes about 1 minute:

doc = aw.Document("C:\\Temp\\in.txt")
doc.first_section.page_setup.paper_size = aw.PaperSize.A3
doc.save("C:\\Temp\\out.pdf")