[英]How to get PDF coordinates of specific selected area?
I've a task to compare two pdfs to which I've used the following library:我的任务是比较我使用以下库的两个 pdf:
https://github.com/red6/pdfcompare https://github.com/red6/pdfcompare
The issue is, I've to ignore some parts of pdf and I need coordinates for that.问题是,我必须忽略 pdf 的某些部分,为此我需要坐标。 How do I get the coordinates as mentioned in the documentation?如何获取文档中提到的坐标? I've researched but all the tools used just shows x and y coordinates, I need 4 dimensions here.我研究过,但所有使用的工具只显示 x 和 y 坐标,我在这里需要 4 个维度。
exclusions: [
{
page: 2
x1: 300 // entries without a unit are in pixels. Pdfs are rendered by default at 300DPI
y1: 1000
x2: 550
y2: 1300
},
{
// page is optional. When not given, the exclusion applies to all pages.
x1: 130.5mm // entries can also be given in units of cm, mm or pt (DTP-Point defined as 1/72 Inches)
y1: 3.3cm
x2: 190mm
y2: 3.7cm
},
{
page: 7
// coordinates are optional. When not given, the whole page is excluded.
}
]
I want to ignore the following in a PDF我想忽略 PDF 中的以下内容
Thank you.谢谢你。
Thanks to @Olivier for directing me.感谢@Olivier 指导我。 I used GIMP to load the PDF, and selected the upper left area of the area I want to ignore, and I copied the position. The same I did with lower right.我使用 GIMP 加载了 PDF,并选择了我要忽略的区域的左上角区域,然后复制了 position。我对右下角也做了同样的事情。 Then I pasted the uper-right into x1 and y1, and lower-right into x2 and y2.然后我将右上角粘贴到 x1 和 y1,将右下角粘贴到 x2 和 y2。 Now, it's working as expected.现在,它按预期工作。 Thank you all.谢谢你们。
The attached screenshot showed what I did.随附的屏幕截图显示了我所做的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.