How To register License in Python using Aspose.Total.LIC File

Hi Team
We are having a Aspose.Total.Lic File for .NET . we need to check How to use Aspose.LIC File in Python. and read table in pdf. pls Do the needful help.

Thanks and Regards,
yajiv Vijay.

from aspose.pdf import License

from aspose import pdf

Load the license

license = License()
license.set_license(“C:\Users\Downloads\Aspose.Total.lic”)

Load source PDF

pdfDocument = pdf.Document(“C:/Users/Documents/Sample_pdf_caplin/Data/Alarm_1.pdf”)

Declare and initialize TableAbsorber object

tableAbsorber = pdf.text.TableAbsorber()

Parse all the tables

tableAbsorber.visit(pdfDocument.pages[1])

Get a reference to the first table

absorbedTable = tableAbsorber.table_list[0]

Iterate through all the rows

for pdfTableRow in absorbedTable.row_list:
# Iterate through all the columns
for pdfTableCell in pdfTableRow.cell_list:
# Fetch the text fragments
textFragmentCollection = pdfTableCell.text_fragments
# Iterate through the text fragments
for textFragment in textFragmentCollection:
# Display the text
print(textFragment.text)
print(“Data read successfully from the table”)

Hi team ,
we are having this below error
RuntimeError: Proxy error(InvalidOperationException): The license is not valid for this product.

Thanks and regards,
yajiv Vijay

@YajiV_Vijay,

Please note, Aspose.Total for .NET license cannot be used with Python APIs, it can only be used for Aspose .NET APIs. You need to have Python license to work with Aspose for Python SDK/library, e.g., Aspose.Total for Python.NET.lic or Aspose.PDF for Python.NET.lic.