-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Closed
Description
Is there a way to convert a .docx
to .pdf
using reportlab
?
I have this code but I don't find a way to achieve the addition of each page to canvas.Canvas()
, to convert to a pdf without using an external application. I want to add into the canvas each page of the document, like a copy paste or like a screenshot to convert to an image and add it to the canvas.
documentStream = Document(BytesIO(WordStream.getvalue()))
seccion = documentStream.sections[0]
height = seccion.page_height
width = seccion.page_width
application = BytesIO()
documentStream.save(application)
application.seek(0)
canva = canvas.Canvas(application)
canva.setPageSize((round(width.pt), round(height.pt)))
canva.showPage()
canva.save()
application.seek(0)
Metadata
Metadata
Assignees
Labels
No labels