我有一个 PDF 文件,它的外部参照和尾部已被覆盖,但能够提取流对象(zlib
压缩)并将它们连接成看起来像一系列路径构造命令。以下是前 30 行左右:
0.750000 0.000000 0.000000 -0.750000 0.000000 841.890015 cm
q
q
1.000000 1.000000 1.000000 rg
0.000000 0.000000 m
0.000000 1122.520020 l
793.700989 1122.520020 l
793.700989 0.000000 l
h
f*
Q
q
0.000000 48.000000 m
793.700989 48.000000 l
793.700989 1074.719971 l
0.000000 1074.719971 l
0.000000 48.000000 l
h
W* n
q
0.000000 0.000000 0.000000 rg
81.701302 106.030998 m
81.701302 105.721001 81.952400 105.470001 82.262100 105.470001 c
82.571800 105.470001 82.822899 105.721001 82.822899 106.030998 c
82.822899 106.341003 82.571800 106.592003 82.262100 106.592003 c
81.952400 106.592003 81.701302 106.341003 81.701302 106.030998 c
h
81.757301 106.142998 m
81.757301 105.828003 82.012901 105.572998 82.328102 105.572998 c
82.643402 105.572998 82.898903 105.828003 82.898903 106.142998 c
82.898903 106.459000 82.643402 106.713997 82.328102 106.713997 c
82.012901 106.713997 81.757301 106.459000 81.757301 106.142998 c
h
是否有可能根据这些数据重建原始文件(或者至少了解一下“绘图”应该代表什么?)
理想的解决方案是 Python 库,但是任何可行的东西我都会很高兴。