![38% of CISOs Fear They’re Not Moving Fast Enough on AI](https://cdn.sanity.io/images/cgdhsj6q/production/faa0bc28df98f791e11263f8239b34207f84b86f-1024x1024.webp?w=400&fit=max&auto=format)
Security News
38% of CISOs Fear They’re Not Moving Fast Enough on AI
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Aspose.PDF for Python via .NET is a PDF Processing library to perform document management can easily be used to generate, modify, convert, render, secure and print documents without using Adobe Acrobat.
Product Page | Documentation | Demos | Blog | API Reference | Search | Free Support | Temporary License
Try our Free Online Apps demonstrating some of the most popular Aspose.PDF functionality.
Aspose.PDF for Python via .NET is a native library that enables the developers to add PDF processing capabilities to their applications. It can be used to generate or read, convert and manipulate PDF files without the use of Adobe Acrobat. Aspose.PDF for Python via .NET allows to perform a range of document processing tasks such as form processing, get and set metadata information, text and page manipulation, management of annotations, add or remove bookmarks and watermarks, attachments, custom font handling and much more. Check out the Landing Pages of Aspose.PDF for Python via .NET for a more detailed description of the features and possibilities of the library.
Aspose.PDF for Python via .NET supports PDF versions 1.2, 1.3, 1.4, 1.5, 1.6, 1.7 and 2.0.
Aspose.PDF for Python via .NET library allows you to successfully, quickly and easily convert your PDF documents to the most popular formats and vice versa.
The following table indicates the file formats that Aspose.PDF for Python via .NET can load and Save.
Format | Description | Load | Save | Remarks |
---|---|---|---|---|
Portable Document Format | Yes | Yes | ||
CGM | Computer Graphics Metafile for 2D vector graphics | Yes | No | |
EPUB | Ebook file format | Yes | Yes | |
HTML | HTML Format | Yes | Yes | |
TeX | LaTex typesetting file format | Yes | Yes | |
MHT | MHTML Document | Yes | No | |
PCL | Printer Control Language Files | Yes | No | |
PS | Postscript Files | Yes | No | |
SVG | Scalable Vector Graphics (An XML-based vector image format) | Yes | Yes | |
XML | XML Format | Yes | Yes | |
XPS | XPS Documents | Yes | Yes | |
XSLFO | XSL-FO is part of XSL file which is used for the transformation and formatting of XML data | Yes | No | |
MD | Markdown Format | Yes | No | |
XLS | Saves the document in the Microsoft Excel SpreadSheet | No | Yes | |
XLSX | Saves the document in the Microsoft Excel 2007 format | No | Yes | |
PPTX | Saves the document in the Microsoft PowerPoint Presentations format | No | Yes | |
DOC | Saves the document in the Microsoft Word format | No | Yes | |
DOCX | Saves the document in the Microsoft Word format | No | Yes | |
MobiXML | Saves the document in eBook MobiXML Standard format | No | Yes | |
JPEG | Saves the document in JPEG Format | Yes | Yes | |
EMF | Enhanced metafile format (EMF) | Yes | Yes | |
PNG | Saves the document in PNG Format | Yes | Yes | |
BMP | Saves the document in BMP Format | Yes | Yes | |
GIF | Graphic Interchange Format | No | Yes | |
TIFF | Saves the document as Single or Multi-Page TIFF Image | Yes | Yes | |
Text | Save the document int Text Format | Yes | Yes |
Aspose.PDF for Python via .NET can be used to develop 32-bit and 64-bit Python applications for different operating systems (such as Windows and Linux) where Python 3.7 or later is installed.
Run pip install aspose-pdf
to fetch the package. If you already have Aspose.PDF for Python via .NET and want to get the latest version, please run pip install --upgrade aspose-pdf
.
To learn more about Aspose.PDF for Python via .NET and explore the basic requirements and features of the library, check out the following Aspose.PDF for Python via .NET Documentation pages for other use cases.
In the next code snippet, we are creating a PDF document fron scratch containing the text “Hello World!”. After installing Aspose.PDF for Python via .NET in your environment, you can execute below code sample to see how Aspose.PDF API works.
Below code snippet follows these steps:
The following code snippet is a “Hello, World!” program to exhibit working of Aspose.PDF for Python via .NET API:
import aspose.pdf as ap
# Initialize document object
document = ap.Document()
# Add page
page = document.pages.add()
# Initialize textfragment object
text_fragment = ap.text.TextFragment("Hello,world!")
# Add text fragment to new page
page.paragraphs.add(text_fragment)
# Save updated PDF
document.save("output.pdf")
Aspose.PDF for Python via .NET is a PDF manipulation API that lets you convert any existing HTML documents to PDF format. The process of converting HTML to PDF can be flexibly customized.
Below code snippet follows these steps:
import aspose.pdf as ap
# Instantiate an object of HtmlLoadOptions
options = ap.HtmlLoadOptions()
# Convert HTML to PDF
document = ap.Document("input.html", options)
# Save PDF
document.save("output.pdf")
Aspose.PDF for Python via .NET supports the feature to convert SVG image to PDF format. To accomplish this requirement, the SvgSaveOptions class has been introduced into the Aspose.PDF namespace. Instantiate an object of SvgSaveOptions and pass it as a second argument to the Document.Save(..) method.
Below code snippet follows these steps:
import aspose.pdf as ap
# Open PDF document
document = ap.Document("input.pdf")
# Instantiate an object of SvgSaveOptions
saveOptions = ap.SvgSaveOptions()
# Do not compress SVG image to Zip archive
saveOptions.compress_output_to_zip_archive = False
saveOptions.treat_target_file_name_as_directory = True
# Save the output in SVG files
document.save("output.svg", saveOptions)
Merge multiple PDF into single file in Python with Aspose.PDF programmatically. PDF files are merged such that the first one is joined at the end of the other document.
Below code snippet follows these steps:
import aspose.pdf as ap
# Open first document
document1 = ap.Document("input_1.pdf")
# Open second document
document2 = ap.Document("input_2.pdf")
# Add pages of second document to the first
document1.pages.add(document2.pages)
# Save concatenated output file
document1.save("output.pdf")
You can print a PDF file to an XPS printer, or some other soft printer for that matter, using the PdfViewer class.
Below code snippet follows these steps:
import aspose.pdf as ap
import aspose.pydrawing as drawing
# Create PdfViewer object
viewer = ap.facades.PdfViewer()
# Open input PDF file
viewer.bind_pdf("input.pdf")
# Set attributes for printing
# Print the file with adjusted size
viewer.auto_resize = True
# Print the file with adjusted rotation
viewer.auto_rotate = True
# Do not produce the page number dialog when printing
viewer.print_page_dialog = False
# Create objects for printer and page settings
ps = ap.printing.PrinterSettings()
pgs = ap.printing.PageSettings()
# Set XPS/PDF printer name
ps.printer_name = "Microsoft XPS Document Writer"
# Or set the PDF printer
# ps.printer_name = "Adobe PDF"
# Set PageSize(if required)
pgs.paper_size = ap.printing.PaperSize("A4", 827, 1169)
# Set PageMargins(if required)
pgs.margins = ap.devices.Margins(0, 0, 0, 0)
# Print document using printer and page settings
viewer.print_document_with_settings(pgs, ps)
# Close the PDF file after printing
viewer.close()
Product Page | Documentation | Demos | Blog | API Reference | Search | Free Support | Temporary License
FAQs
Aspose.PDF for Python via .NET is a PDF Processing library to perform document management can easily be used to generate, modify, convert, render, secure and print documents without using Adobe Acrobat.
We found that aspose-pdf demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.
Security News
Company News
Socket is joining TC54 to help develop standards for software supply chain security, contributing to the evolution of SBOMs, CycloneDX, and Package URL specifications.