Im trying to convert a Base64 Docx to a Base64 pdf, for test purpose im receiving the base64 docx and im saving it in my Django static folder like this:
Proyect
--App
----static
------Docs
--------test.docx
So, Im trying with doxc2pdf library to make the convertion and the into base64 like this:
class Converttest(View):
def post(self, request, *args, **kwargs):
template = loader.get_template('home.html')
testdoc = static('Docs/test.docx')
pdf = convert(testdoc)
encoded = base64.b64encode(pdf)
context = {}
return HttpResponse(template.render(context, request))
But im getting this error:
pywintypes.com_error: (-2147221005, 'Invalid class string', None, None)
> g:\python_projects\reps\stratos\strategy\views.py(162)post()
-> convert(testdoc)
Any idea what am I doing wrong ?