PDF裁剪框中的坐标指的是什么尺寸? [英] What dimensions do the coordinates in PDF cropbox refer to?
问题描述
例如,如果某人的pdf的页面大小指定错误,则可以使用 ghostscript 和命令参数/CropBox
.我的问题是,命令中的数字指的是什么?我知道它们是点单位(72英寸),但是它们的原点和轴是什么?
If one has, for example, a pdf with the wrong page size specified one can crop away the unwanted portions of the document with ghostscript and the command parameter /CropBox
. My question is, what do the numbers in the command refer to? I know they are point units (72nds of an inch) but what are their origins and axes?
根据的错误提示我想出以下方法,使页面距11"x8.5"页面的左上角大约6"x4"(示例来源pdf ).不过,我想进行数学运算,并得到精确的数字,而不是近似的数字(我的最后一页必须为横向A6,5.83"x4.13").
By dint of trail and error from this example I've come up with following to keep an area approximately 6"x4" from the top left corner of a 11"x8.5" page (example source pdf). I'd like to do the math though and get my numbers precise instead of approximate (my final page needs to be landscape A6, 5.83"x4.13").
gswin64c ^
-o fixed-A6.pdf ^
-sDEVICE=pdfwrite ^
-c "[/CropBox [0 315 420 610] /PAGES pdfmark" ^
-f landscape-letter-size.pdf
此外,括号[ ]
应该不平衡吗?开口[/Crop...
没有相应的关闭位置.
Also, are the brackets [ ]
supposed to be unbalanced? The opening [/Crop...
doesn't have a corresponding close.
推荐答案
它们与Page对象中定义的其他框具有相同的原点(例如,默认为Points中的单位,其原点位于左下角.您可以看到 PDF 1.7文档供进一步参考.有些命令可以驻留在更高级别的对象(页面)上顺便说一句可以改变坐标系,但是很少见(当您使用ghostscript自己创建PDF时就会知道).
They have the same origin as the other boxes defined in the Page object (eg default to units in Points with the origin to the lower left corner. You can see the PDF 1.7 documentation for further reference. There are some commands that can reside on higher level objects (Pages) that change the coordinate system by the way but those are rare (and when you create your PDF yourself with ghostscript you would know)..
每个数字均从左下角空白处引用.因此,在示例中,0 315
表示从左起0pt,在底部之上315pt,并且420 610
是矩形的相对角,从相同的原点开始. [0 315 420 610] =矩形(左下右上)
Each number is referenced from the bottom left corner margin. So from the example 0 315
means 0pt from the left and 315pt above the bottom, and 420 610
is the opposite corner of the rectangle, from the same origin. [0 315 420 610] = rectangle (left bottom right top)
****************************************************
610 ----------------------X 420,610 *
| | *
| | *
| | *
| | *
| | *
| | *
| | *
|0,315 | *
315 X---------------------- *
* *
* *
* *
* *
* *
* *
* *
* *
0 ****************************************************
0 420
这篇关于PDF裁剪框中的坐标指的是什么尺寸?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!