I need help in converting pdf to docx. I found one library pdf2docx but this is a GNU license so I can't use this library to convert is there any library that I can use? I want to maintain the layout and all information and pdf files also contain images.
I have also tried converting the pdf to docx using subprocess this works but the file is corrupted.
Libraries that I have found are:
pikepdf
pdfminer.six
pymupdf
pdfrw
pdfplumber
etc...
In short I am looking for a pdf2docx library alternative.
Please help me with this....
Related
I have an .xlsx file I generate using xlsxwriter in a python script (version 2.7). I am trying to find a way to convert a worksheet in the file to a PDF format. I have not found a module that suits my needs yet.. simple, lightweight, and is able to be installed using pip.
Any suggestions, let's hear them! Thanks to all!
Try using a comdination of openpyxl and PDFwriter as shown in this example this example
It could be some kind of question similar to this one
But methods described there aren't applicable to my situation. I'm looking for a tool to use from Python or just a standalone Linux binary. All, that I've already found are only Win/MSO-related methods:(
Is there any way to simply clean docx tags in Linux?
Thanks!
I've tried to use headless LibreOffice as a convertor from DOCX to DOCX and it seemed to help with most of the cases.
libreoffice --headless --convert-to docx ./Copyright\ license.docx
Nevertheless, this way needs more testing.
I am developing a full text search engine for indexing popular binary formats. I know that there are hundereds of such questions (and solutions) already, but I found it tough to find one:
cross platform
supports DOC, DOCX and PDF formats at once
easy to use with python
can be set up in a major shared host
For PDFs, I recommend PDFminer.
Try the docx module (I have not used it myself)
I am not aware of any pure python module that can read .doc files.
There are command-line tools to extract text from .doc files: antiword and catdoc (and probably others). If the packages are installed on your shared host, you could use subprocess to shell out to these tools. Available on Windows via Cygwin.
Apache POI is a Java library that can extract text from Office documents. If your shared host has Java installed, you could write a bit of Java (or Jython) code and execute using subprocess.
If at server side you can use OpenOffice then you can use unoconv: Convert between any document format supported by OpenOffice
One possible solution is to use google documents to extract the text contents from binary .doc-files. You upload the document to google docs and then download the text contents. It is a fairly slow process, but it is the only "pure Python" solution I know of since it doesn't require any external tools except for network access. An external tool such as catdoc or antiword is a much better solution if you are allowed to install it on your host.
Textract uses the default tools for every kind of file.
https://github.com/deanmalmgren/textract
I have a problem when using reportlab and py2exe. It works normal on python but much error on reportlab modules when running the exe file after compiled by py2exe. Can you suggest a library or code in python way to convert a text files (with tables) to pdf format without using reportlab. Thanks.
I used pyPdf in the past, which is quite good for quick and dirty solutions, though I would hesitate before using it for large projects.
Is there any existing Python library that can validate data in Excel format? Or what kind of keyword should I use to search such an open source project? Thanks.
[Disclosure: I'm the author of xlrd]
xlrd allows you to extract data from XLS files. XLSX support is in alpha testing; e-mail me if you need it. You get told precisely what is in each cell (Excel cell type and value). It runs on Python 2.1 to 2.7 on any platform. You don't need Windows. You don't need Excel to be installed on your machine. Start with the tutorial found here.
I`m not sure what are you looking for, but there are three libraries that, in combination, can read and write excel files:
xlrd
xlwt
xlutils
They read and save binary excel archives both in windows and linux. There are functions for formatting data and styles.
If you want to check if some data column is in a given format you can do it with these libs (basically with xlrd).