We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Using ASPOSE in Python code for editing a document

Requirement :
Editing a PDF document to modify some of the written-content / tables while keeping the formatting and embedded images intact on the page.

Can you please guide me to any documentation for use of aspose in python codes ?

I am getting the following error while accessing a paragraph for editing:

cursor_Para = doc.getFirstSection().getBody().getFirstParagraph().getText();

AttributeError: ‘aspose.words.Document’ object has no attribute ‘getFirstSection’

Please guide me to the documentation for implementation using python.

@SoumyaJ You are using Java syntax. In Python, you should use the following code:

cursor_Para = doc.first_section.body.first_paragraph.get_text()

You can find mode Python examples in our documentation and on Github.

Also, you should note, that Aspose.Words is designed to work with MS Word documents, which are flow documents. Though, Aspose.Words supports loading PDF documents, upon loading fixed page PDF document is converted to flow document representation. So there is no warranty that after editing the document, its layout will remain unchanged.