Proxy error(NullReferenceException) in aspose.pdf (python via .Net)

388 Views Asked by At

To convert pdf to HTML, I am using the aspose.pdf library. I have installed the library through pip3 install aspose-pdf. This library works fine for my Windows machine in Python, version 3.8. But facing an error in linux machine: Proxy error(NullReferenceException): Object reference not set to an instance of an object. I have tried Centos and Ubuntu, but getting the same error. source code:

import aspose.pdf as pdf

doc = pdf.Document("input.pdf")
saveOptions = pdf.HtmlSaveOptions()
doc.save("output.html", saveOptions)

system details:

  • OS: Ubuntu 20.04.3, centos 7
  • Python version: Python 3.8.10
  • Aspose.pdf: 23.5.0 (python via . Net)

I have installed the library through pip3 install aspose-pdf. This library works fine for my Windows machine in Python. I hope my code source works on Linux machine.

1

There are 1 best solutions below

2
Alexey Noskov On

You can also try using Aspose.Words for Python, which also support conversion form PDF to HTML:

import aspose.words as aw

doc = aw.Document("in.pdf")
doc.save("out.html")

Please see Aspose.Words documentation to learn about additional requirements, when use Aspose.Words for Python under Linux: https://docs.aspose.com/words/python-net/system-requirements/#system-requirements-for-target-linux-platform