Combine two lists of PDFs one to one using Python -
i have created series of pdf documents (maps) using data driven pages in esri arcmap 10. there page 1 , page 2 each map generated separate *.mxd. have 1 list of pdf documents containing page 1 each map , 1 list of pdf documents containing page 2 each map. example: map1_001.pdf, map1_002.pdf, map1_003.pdf...map2_001.pdf, map2_002.pdf, map2_003.pdf...and one.
i append these maps, pages 1 , 2, both page 1 , 2 in 1 pdf per map. example: mapboth_001.pdf, mapboth_002.pdf, mapboth_003.pdf... (they don't have go new pdf file (mapboth), it's fine append them map1)
for each map1_ *.pdf walk through directory , append map2_ *.pdf numbers (where * is) in file name match
there must way using python. maybe combination of arcpy, os.walk or os.listdir, , pypdf , loop?
for pdf in os.walk(datadirectory):
?? any ideas? kindly help.
a pdf file structured in different way plain text file. putting 2 pdf files wouldn't work, file's structure , contents overwritten or become corrupt. author own, take fair amount of time, , intimate knowledge of how pdf internally structured.
that said, recommend pypdf. supports merging feature you're looking for.
Comments
Post a Comment