Python novices will learn to integrate [pdf]


When downloading courseware is often divided into many small pdf's, also a few pages, you want to integrate into a whole big pdf, then Baidu a little, there are many online online pdf integrator, but since this egg pain network speed, traffic spend money, or do you want local.

He says python is omnipotent, so a search on pypi, really full of all yes. For example, this PyPDF2, in addition if you are just learning python soon, and problems, you can go to small series of Python exchange dress: a long time Wu that while the down stream a thought (digital homonym) conversion can be found, there are new Python Tutorial Project to be had, I do not understand the problem more exchanges with people inside will solve Oh!

Simply looked at the document, the structure is very simple, the most important is PdfFileReader class and PdfFileWriter class.

So full of small open pdf folder from 0.pdf to 16.pdf just your eyes sting. Open vscode, enter the following code, read write read and write perfectly.

from PyPDF2 import PdfFileReader,PdfFileWriter

= PdfFileWriter Output ()
for I in Range (. 17):
INPUT = PdfFileReader (Open (STR (I) + '. PDF', 'RB'))
NUM = input.getNumPages ()
for n-in Range (NUM):
Output .addPage (input.getPage (n-))
the outputStream = Open ( "output.pdf", "WB")
output.write (the
outputStream) ----------------
text herein, and Photos from the network with their own ideas, only to learn, exchange, not for any commercial purposes, belongs to original author, if any questions, please contact us for treatment.

Guess you like

Origin www.cnblogs.com/chengxuyuanaa/p/12090851.html