PHP将Trim框或出血框插入PDF文档 [英] PHP Insert Trim box or bleed box into PDF document

查看:108
本文介绍了PHP将Trim框或出血框插入PDF文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个任意大小的PDF文档,我想使用PHP刻录或在PDF中插入修剪框.可能与Imagemagick一起使用,但不知道要运行的命令(不确定是否存在该命令)

I have a PDF document that can be any size and I would like to burn in or insert a trim box into that PDF using PHP. Possibly with Imagemagick but do not know the command to run (not sure if one even exists)

我做了很多搜索,还没有找到任何可以回答我问题的东西,所以我希望有人可能知道.我会提供代码,但我什至不知道要使用什么命令来提供我尝试过的任何代码.有什么帮助吗?

I did a lot of searching and havent found anything that answers my question so I am hoping someone may know. I would provide code but I do not even know what commands to use to provide any code of what I have tried. Any help please?

推荐答案

使用命令行浏览了许多裁剪工具后,没有任何事情能像我预期的那样完美地工作.我尝试了Ghostscript和Imagemagick,它们具有脚本,但不能按我的意愿运行,因此,我现在最喜欢的工具为此,它可以完美地工作,称为Briss,它是一个免费工具,您可以找到

After going through lots of cropping tools using command line, nothing was working perfectly as I expected. I tried Ghostscript and Imagemagick, they have the script but it doesn't work as I want, so my favorite tool now for this and it works perfectly it called Briss and its a free tool that you can find here as an example for the command, you will need to call this command using PHP :

 java -jar briss-0.9.jar -s original.pdf -d cropped.pdf -c 0.11/0.08/0.11/0.08:0.11/0.08/0.11/0.08

这是从左侧开始以英寸为单位的每个值的说明

And this is an explanation for each value from the left in inch

 First  param : Upper  space for even 
 Second param : Right  space for even 
 Third  param : bottom space for even 
 Forth  param : left   space for even

 Sixth   param : Upper  space for odd 
 Seventh param : Right  space for odd 
 Eighth  param : bottom space for odd 
 Ninth   param : left   space for odd

希望对您有帮助

这篇关于PHP将Trim框或出血框插入PDF文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆