1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
|
From c82f6e80d94f8598221009035c8f336f5f656333 Mon Sep 17 00:00:00 2001
From: Ashod Nakashian <ashod.nakashian@collabora.co.uk>
Date: Tue, 5 Jun 2018 11:35:14 +0200
Subject: [PATCH 11/14] svx: correctly possition form objects from PDF
---
pdfium/fpdfsdk/fpdf_editpage.cpp | 25 +++++++++++++++++++++++++
pdfium/public/fpdf_edit.h | 18 ++++++++++++++++++
2 files changed, 43 insertions(+)
diff --git a/pdfium/fpdfsdk/fpdf_editpage.cpp b/pdfium/fpdfsdk/fpdf_editpage.cpp
index bf68250..f4a1688 100644
--- a/pdfium/fpdfsdk/fpdf_editpage.cpp
+++ b/pdfium/fpdfsdk/fpdf_editpage.cpp
@@ -810,3 +810,28 @@ FPDFFormObj_GetSubObject(FPDF_PAGEOBJECT form_object, int index)
return nullptr;
}
+
+FPDF_EXPORT void FPDF_CALLCONV
+FPDFFormObj_GetMatrix(FPDF_PAGEOBJECT form_object,
+ double* a,
+ double* b,
+ double* c,
+ double* d,
+ double* e,
+ double* f)
+{
+ if (!form_object || !a || !b || !c || !d || !e || !f)
+ return;
+
+ CPDF_FormObject* pFrmObj = CPDFFormObjectFromFPDFPageObject(form_object);
+ if (pFrmObj)
+ {
+ const CFX_Matrix& matrix = pFrmObj->form_matrix();
+ *a = matrix.a;
+ *b = matrix.b;
+ *c = matrix.c;
+ *d = matrix.d;
+ *e = matrix.e;
+ *f = matrix.f;
+ }
+}
diff --git a/pdfium/public/fpdf_edit.h b/pdfium/public/fpdf_edit.h
index ca76954..f249e64 100644
--- a/pdfium/public/fpdf_edit.h
+++ b/pdfium/public/fpdf_edit.h
@@ -1098,6 +1098,24 @@ FPDFFormObj_CountSubObjects(FPDF_PAGEOBJECT form_object);
FPDF_EXPORT FPDF_PAGEOBJECT FPDF_CALLCONV
FPDFFormObj_GetSubObject(FPDF_PAGEOBJECT form_object, int index);
+// Get the matrix of a particular form object.
+//
+// form_object - Handle of form object
+// a - Pointer to a double value receiving coefficient "a" of the matrix.
+// b - Pointer to a double value receiving coefficient "b" of the matrix.
+// c - Pointer to a double value receiving coefficient "c" of the matrix.
+// d - Pointer to a double value receiving coefficient "d" of the matrix.
+// e - Pointer to a double value receiving coefficient "e" of the matrix.
+// f - Pointer to a double value receiving coefficient "f" of the matrix.
+FPDF_EXPORT void FPDF_CALLCONV
+FPDFFormObj_GetMatrix(FPDF_PAGEOBJECT form_object,
+ double* a,
+ double* b,
+ double* c,
+ double* d,
+ double* e,
+ double* f);
+
#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
--
2.16.3
|