Edit PDF in Python
High-speed and cross-platform Python library for editing PDF using Python code
Edit PDF using Aspose.Slides
Aspose.Slides for Python via .NET is a powerful Python library used to manipulate and edit presentations, PDF documents, and other files. You can edit an PDF doc by adding a new line of text to it.
Edit PDF in Python
Using Aspose.Slides for Python via .NET , you can add a new line of text to an PDF document with just a few lines of code.
Python code for editing PDF
import aspose.slides as slides
with slides.Presentation() as pres:
pres.slides.remove_at(0)
pres.slides.add_from_pdf("document.pdf")
shape = pres.slides[0].shapes.add_auto_shape(slides.ShapeType.RECTANGLE, 10, 10, 100, 50)
shape.text_frame.text = "New text"
pres.save("document.pdf", slides.export.SaveFormat.PDF)
How to edit PDF in Python
Install Aspose.Slides for Python via .NET. See Installation .
Add the library as a reference in your project.
Create an instance of the Presentation class.
Load the PDF document you want to edit.
Add a new line of text.
Save the changed PDF file.