Cropping pages of a .pdf file

前端 未结 5 1963
野的像风
野的像风 2020-12-01 01:31

I was wondering if anyone had any experience in working programmatically with .pdf files. I have a .pdf file and I need to crop every page down to a certain size.

Af

5条回答
  •  独厮守ぢ
    2020-12-01 02:26

    You can convert the PDF to Postscript (pstopdf or ps2pdf) and than use text processing on the Postscript file. After that you can convert the output back to PDF.

    This works nicely if the PDFs you want to process are all generated by the same application and are somewhat similar. If they come from different sources it is usually to hard to process the Postscript files - the structure is varying to much. But even than you migt be able to fix page sizes and the like with a few regular expressions.

提交回复
热议问题