PDF extract Text to HTML notes

Source: Internet
Author: User
Tags html notes

I used to test too many files for the conversion of the PDF, and now I'm a little dizzy myself.

Furthermore, the PDF file downloaded from Cnki does not know why Pdf2htmlex cannot be converted.

Xpdf

Xpdf use: Refer to links http://blog.csdn.net/jiang1984j/article/details/5757427 and http://my.oschina.net/zbrxtpgyaps/blog/ 28171?fromerr=zd6ms31i

I'll use the process again to comment out the http://blog.csdn.net/jiang1984j/article/details/5757427 under this connection displaycidfonttt.

This link http://www.jb51.net/softjc/20047.html is also one of the references, note the folder relationship inside

All of these are solutions to the problem of Chinese. Xpdf conversion effect is a bit poor, especially the number of columns of data, is basically chaotic.

Pdf2htmlex

And then it's Pdf2htmlex, really powerful. The converted HTML style is also particularly attractive, but PDF files downloaded from Cnki cannot be converted (Error: Tounicode CMap is not valid and got dropped, Then part of the Chinese will not show, if someone knows how to solve to teach me),

Testing is not related to whether the computer is installed or not, and it is suspected to be a problem with the PDF file itself.

This file only needs the Data folder and Pdf2htmlEX.exe these two can run: cmd command pdf2htmlex file.pdf outfile.pdf

: http://soft.rubypdf.com/software/pdf2htmlex-windows-version

Option translation: http://m.oschina.net/blog/206900

Others use CMake to compile their own, but unfortunately not.

Here is the use of Pdfminer

Pdfminer installation is troublesome, installed several times, has forgotten how to install, if the code in the process of running the import error, it may be the version of the installation package problem, I have encountered in the process that the author has changed the function in subsequent versions.

1 ImportOS2Parent ="g:/python/pythonproject/pdf"3 Os.chdir (parent)4 5  fromPdfminer.pdfinterpImportPdfresourcemanager, Pdfpageinterpreter6  fromPdfminer.pdfpageImportPdfpage7  fromPdfminer.converterImportXmlconverter, Htmlconverter, Textconverter8  fromPdfminer.layoutImportLaparams9  fromCstringioImportStringioTen  One  A defpdfparser (data): -  -  theoutfile = data+'. txt' -fp = file (data,'RB') -OUTFP = File (outfile,'W') -Rsrcmgr =Pdfresourcemanager () +Retstr =Stringio () -codec ="Utf-8" +Laparams =Laparams () Adevice = Textconverter (Rsrcmgr, OUTFP, Codec=codec, laparams=laparams) at     #Create a PDF interpreter object. -Interpreter =pdfpageinterpreter (rsrcmgr, device) -     #Process each page contained in the document. -      -      -  in      forPageinchpdfpage.get_pages (FP): -         #Print Page to interpreter.process_page (page) +data =Retstr.getvalue () -         #layout = Device.get_result () the          *  $     PrintDataPanax Notoginseng  -  the device.close () + outfp.close () A  the  + if __name__=='__main__': -Pdfparser (U'Research on fast identification framework of verification code based on PiL _ Hu Guangzhong. pdf')

Overall Pdfminer results can be read, but the format is particularly confusing, but better than xpdf, and there are still errors. Super slow speed. Pdfminer documents do not understand, do not know whether someone can write a detailed usage.

Chinese is the difficulty of implementation, a lot of English support is particularly good, but in the Chinese here is not.

Just write it here, and remember it later, in the update!

PDF extract Text to HTML notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.