我在ESRI ArcMap 10中使用数据驱动页面创建了一系列PDF文档(地图)。从单独的*.mxd生成的每个映射都有一个第1页和第2页。所以我有一个包含每个地图的第1页的PDF文档列表和每个地图包含第2页的PDF文档列表。例如:Map1_001.pdf,Map1_002.pdf,Map1_003.pdf…map2_001.pdf,map2_002.pdf,map2_003.pdf…等等。在
我想把这些地图,第1页和第2页放在一起,这样第1页和第2页都在一张PDF格式的地图上。例如:mapbooth_001.pdf、mapbooth_002.pdf、mapbooth_003.pdf。。。(它们不必进入新的pdf文件(mapboth),可以将它们附加到map1中)
对于每张地图1*.pdf 遍历目录并在文件名中的数字(其中*是)匹配的地方追加map2_*.pdf
必须有一种使用python的方法来实现它。也许是和arcpy的组合,手术室步行或者操作系统列表目录,以及pyPdf和for循环?在
pdf格式手术室步行(数据目录):
??
有什么想法吗?谢谢你的帮助。在
这应该可以正确地找到并整理所有要合并的文件;它仍然需要实际的.pdf合并代码。在
编辑:我添加了基于the pyPdf example code的pdf编写代码。它没有经过测试,但应该(尽我所能)正常工作。在
Edit2:意识到我有地图编号的交叉方式;重新调整它以合并正确的地图集。在
我没有任何测试pdf可以尝试组合,但是我用一个cat命令对文本文件进行了测试。 您可以尝试一下(我假设是基于unix的系统):合并.py在
基本上,它遍历并获取maps1列表,然后遍历并假设文件是正确的,然后遍历数字。(我可以看到使用计数器来完成此操作,并用0填充以获得类似的效果)。在
首先测试gs命令,我只是从http://hints.macworld.com/article.php?story=2003083122212228抓取它。在
PDF文件的结构与纯文本文件不同。简单地将两个PDF文件放在一起是行不通的,因为文件的结构和内容可能会被覆盖或损坏。当然,您也可以自己编写,但这需要相当长的时间,以及对PDF内部结构的深入了解。在
也就是说,我建议你调查一下{a1}。它支持您正在寻找的合并功能。在
相关问题 更多 >
编程相关推荐