New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

Convert2PDF

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

Convert2PDF

Convert from different file formats to PDF format.

pipPyPI
Version
0.3
Maintainers
1

License: GNU GPLv3

How to install

pip install Convert2PDF

How to import

from Convert2PDF.ConvertToPDF import docx2pdfConvert, pptx2pdfConvert, img2pdfConvert, bmp2pdfConvert, txt2pdfConvert, mergePdfs

Dependencies needs to be installed, if using docx2pdfConvert() & pptx2pdfConvert()

libreoffice
build-essential
libssl-dev
libffi-dev
python-dev
default-jre

Documentation

Convert from doc or docx to pdf format.

docx = docx2pdfConvert(f'{os.getcwd()}/file name.docx', f'{os.getcwd()}/output_dir/')
doc = docx2pdfConvert(f'{os.getcwd()}/file name.doc', f'{os.getcwd()}/output_dir/')

Convert from ppt or pptx to pdf format

pptx = pptx2pdfConvert(f'{os.getcwd()}/file name.pptx', f'{os.getcwd()}/output/')
ppt = pptx2pdfConvert(f'{os.getcwd()}/file name.ppt', f'{os.getcwd()}/output/')

Convert from jpeg, jpg or png ot pdf format.

jpeg = img2pdfConvert(f'{os.getcwd()}/file name.jpeg', f'{os.getcwd()}/output/file name.pdf')
jpg = img2pdfConvert(f'{os.getcwd()}/file name.jpg', f'{os.getcwd()}/output/file name.pdf')
png = img2pdfConvert(f'{os.getcwd()}/file name.png', f'{os.getcwd()}/output/file name.pdf')

Convert from bmp to pdf format.

bmp = bmp2pdfConvert(f'{os.getcwd()}/file name.bmp', f'{os.getcwd()}/output/file name.pdf')

Convert from txt to pdf format.

txt = txt2pdfConvert(f'{os.getcwd()}/file name.txt', f'{os.getcwd()}/output/file name.pdf')

Merge all pdf files to one pdf file.

all_pdfs_path_tuple = (
                    f'{os.getcwd()}/file 1.pdf'
                    , f'{os.getcwd()}/file 2.pdf'
                    , f'{os.getcwd()}/file 2.pdf'
                    , f'{os.getcwd()}/file 3.pdf'
                    , f'{os.getcwd()}/file 4.pdf'
                    , f'{os.getcwd()}/file 5.pdf'
                )
merged = mergePdfs(*all_pdfs_path_tuple, output_pdf_file_path=f'{os.getcwd()}/output_merged_file.pdf')

License

GNU GPLv3

Keywords

ASHFAQUE

FAQs

Did you know?

Socket

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.

Install

Related posts