Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
819d11b7
Kaydet (Commit)
819d11b7
authored
Nis 13, 2018
tarafından
Ashod Nakashian
Kaydeden (comit)
Jan Holesovsky
May 22, 2018
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
svx: improve path importing from PDF
Change-Id: I8e63b2a35d841e065ef32fea95c0a5f22ca6f049
üst
b1083c11
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
125 additions
and
14 deletions
+125
-14
edit.patch.1
external/pdfium/edit.patch.1
+97
-3
svdpdf.cxx
svx/source/svdraw/svdpdf.cxx
+28
-11
No files found.
external/pdfium/edit.patch.1
Dosyayı görüntüle @
819d11b7
...
...
@@ -209,7 +209,7 @@ index ca2cf3f..8073a18 100644
+ return true;
+}
diff --git a/fpdfsdk/fpdfeditpath.cpp b/fpdfsdk/fpdfeditpath.cpp
index a291987..
d3b0bc1
100644
index a291987..
1ac8257
100644
--- a/fpdfsdk/fpdfeditpath.cpp
+++ b/fpdfsdk/fpdfeditpath.cpp
@@ -101,6 +101,16 @@ FPDFPath_SetStrokeWidth(FPDF_PAGEOBJECT path, float width) {
...
...
@@ -229,6 +229,63 @@ index a291987..d3b0bc1 100644
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetFillColor(FPDF_PAGEOBJECT path,
unsigned int R,
unsigned int G,
@@ -217,6 +227,25 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path,
return true;
}
+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetDrawMode(FPDF_PAGEOBJECT path,
+ int* fillmode,
+ FPDF_BOOL* stroke)
+{
+ auto* pPathObj = CPDFPathObjectFromFPDFPageObject(path);
+ if (!pPathObj || !fillmode || !stroke)
+ return false;
+
+ if (pPathObj->m_FillType == FXFILL_ALTERNATE)
+ *fillmode = FPDF_FILLMODE_ALTERNATE;
+ else if (pPathObj->m_FillType == FXFILL_WINDING)
+ *fillmode = FPDF_FILLMODE_WINDING;
+ else
+ *fillmode = 0; // no fill
+
+ *stroke = pPathObj->m_bStroke;
+ return true;
+}
+
FPDF_EXPORT void FPDF_CALLCONV FPDFPath_SetLineJoin(FPDF_PAGEOBJECT path,
int line_join) {
if (!path)
@@ -250,6 +279,30 @@ FPDF_EXPORT void FPDF_CALLCONV FPDFPath_SetLineCap(FPDF_PAGEOBJECT path,
}
FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
+FPDFPath_GetMatrix(FPDF_PAGEOBJECT path_object,
+ double* a,
+ double* b,
+ double* c,
+ double* d,
+ double* e,
+ double* f)
+{
+ if (!path_object || !a || !b || !c || !d || !e || !f)
+ return false;
+
+ auto* pPathObj = CPDFPageObjectFromFPDFPageObject(path_object);
+ CFX_Matrix* pMatrix = pPathObj->m_GeneralState.GetMutableMatrix();
+ *a = pMatrix->a;
+ *b = pMatrix->b;
+ *c = pMatrix->c;
+ *d = pMatrix->d;
+ *e = pMatrix->e;
+ *f = pMatrix->f;
+
+ return true;
+}
+
+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV
FPDFPathSegment_GetPoint(FPDF_PATHSEGMENT segment, float* x, float* y) {
auto* pPathPoint = FXPathPointFromFPDFPathSegment(segment);
if (!pPathPoint || !x || !y)
diff --git a/fpdfsdk/fpdftext.cpp b/fpdfsdk/fpdftext.cpp
index 68bf4f8..e073b20 100644
--- a/fpdfsdk/fpdftext.cpp
...
...
@@ -300,7 +357,7 @@ index 77c2315..db3e734 100644
CPDF_PageObject* CPDFPageObjectFromFPDFPageObject(FPDF_PAGEOBJECT page_object);
diff --git a/public/fpdf_edit.h b/public/fpdf_edit.h
index 54735a3..
282bcdb
100644
index 54735a3..
a415c98
100644
--- a/public/fpdf_edit.h
+++ b/public/fpdf_edit.h
@@ -520,6 +520,15 @@ FPDFPath_GetStrokeColor(FPDF_PAGEOBJECT path,
...
...
@@ -319,7 +376,44 @@ index 54735a3..282bcdb 100644
// Set the line join of |page_object|.
//
// page_object - handle to a page object.
@@ -761,6 +770,73 @@ FPDFPageObj_CreateTextObj(FPDF_DOCUMENT document,
@@ -688,6 +697,36 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_SetDrawMode(FPDF_PAGEOBJECT path,
int fillmode,
FPDF_BOOL stroke);
+// Get the drawing mode of a path.
+//
+// path - the handle to the path object.
+// fillmode - the filling mode to be set: 0 for no fill, 1 for alternate, 2 for
+// winding.
+// stroke - a boolean specifying if the path should be stroked or not.
+//
+// Returns TRUE on success
+FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFPath_GetDrawMode(FPDF_PAGEOBJECT path,
+ int* fillmode,
+ FPDF_BOOL* stroke);
+
+// Get the matrix of a particular text object.
+//
+// path_object - Handle of path object returned by FPDFPath_NewPathObj
+// 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 FPDF_BOOL FPDF_CALLCONV
+FPDFPath_GetMatrix(FPDF_PAGEOBJECT path_object,
+ double* a,
+ double* b,
+ double* c,
+ double* d,
+ double* e,
+ double* f);
+
// Create a new text object using one of the standard PDF fonts.
//
// document - handle to the document.
@@ -761,6 +800,73 @@ FPDFPageObj_CreateTextObj(FPDF_DOCUMENT document,
FPDF_FONT font,
float font_size);
...
...
svx/source/svdraw/svdpdf.cxx
Dosyayı görüntüle @
819d11b7
...
...
@@ -565,7 +565,7 @@ void ImpSdrPdfImport::SetAttributes(SdrObject* pObj, bool bForceTextAttr)
if
(
mpVD
->
IsLineColor
())
{
mpLineAttr
->
Put
(
XLineStyleItem
(
drawing
::
LineStyle_SOLID
));
mpLineAttr
->
Put
(
XLineStyleItem
(
drawing
::
LineStyle_SOLID
));
//TODO support dashed lines.
mpLineAttr
->
Put
(
XLineColorItem
(
OUString
(),
mpVD
->
GetLineColor
()));
}
else
...
...
@@ -1250,6 +1250,10 @@ void ImpSdrPdfImport::ImportImage(FPDF_PAGEOBJECT pPageObject, int nPageObjectIn
void
ImpSdrPdfImport
::
ImportPath
(
FPDF_PAGEOBJECT
pPageObject
,
int
nPageObjectIndex
)
{
SAL_WARN
(
"sd.filter"
,
"Got page object PATH: "
<<
nPageObjectIndex
);
double
a
,
b
,
c
,
d
,
e
,
f
;
FPDFPath_GetMatrix
(
pPageObject
,
&
a
,
&
b
,
&
c
,
&
d
,
&
e
,
&
f
);
basegfx
::
B2DPolygon
aPoly
;
std
::
vector
<
basegfx
::
B2DPoint
>
aBezier
;
...
...
@@ -1266,9 +1270,14 @@ void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT pPageObject, int nPageObjectInd
continue
;
}
SAL_WARN
(
"sd.filter"
,
"Got point ("
<<
x
<<
", "
<<
y
<<
")"
);
x
=
a
*
x
+
c
*
y
+
e
;
y
=
b
*
x
+
d
*
y
+
f
;
const
bool
bClose
=
FPDFPathSegment_GetClose
(
pPathSegment
);
SAL_WARN
(
"sd.filter"
,
"
Got
("
<<
x
<<
", "
<<
y
<<
"): "
<<
(
bClose
?
"CLOSE"
:
"OPEN"
));
"
Point corrected
("
<<
x
<<
", "
<<
y
<<
"): "
<<
(
bClose
?
"CLOSE"
:
"OPEN"
));
Point
aPoint
=
PointsToLogic
(
x
,
y
);
x
=
aPoint
.
X
();
y
=
aPoint
.
Y
();
...
...
@@ -1318,15 +1327,23 @@ void ImpSdrPdfImport::ImportPath(FPDF_PAGEOBJECT pPageObject, int nPageObjectInd
FPDFPath_GetStrokeWidth
(
pPageObject
,
&
fWidth
);
mnLineWidth
=
lcl_ToLogic
(
lcl_PointToPixel
(
fWidth
));
unsigned
int
r
;
unsigned
int
g
;
unsigned
int
b
;
unsigned
int
a
;
FPDFPath_GetFillColor
(
pPageObject
,
&
r
,
&
g
,
&
b
,
&
a
);
mpVD
->
SetFillColor
(
Color
(
r
,
g
,
b
));
FPDFPath_GetStrokeColor
(
pPageObject
,
&
r
,
&
g
,
&
b
,
&
a
);
mpVD
->
SetLineColor
(
Color
(
r
,
g
,
b
));
unsigned
int
nR
;
unsigned
int
nG
;
unsigned
int
nB
;
unsigned
int
nA
;
FPDFPath_GetFillColor
(
pPageObject
,
&
nR
,
&
nG
,
&
nB
,
&
nA
);
SAL_WARN
(
"sd.filter"
,
"Got PATH fill color: "
<<
nR
<<
", "
<<
nG
<<
", "
<<
nB
<<
", "
<<
nA
);
mpVD
->
SetFillColor
(
Color
(
nR
,
nG
,
nB
));
FPDFPath_GetStrokeColor
(
pPageObject
,
&
nR
,
&
nG
,
&
nB
,
&
nA
);
SAL_WARN
(
"sd.filter"
,
"Got PATH stroke color: "
<<
nR
<<
", "
<<
nG
<<
", "
<<
nB
<<
", "
<<
nA
);
mpVD
->
SetLineColor
(
Color
(
nR
,
nG
,
nB
));
// int nFillMode = 0; // No fill.
// bool bStroke = false;
// FPDFPath_GetDrawMode(pPageObject, &nFillMode, &bStroke);
// mpVD->Setstroke(Color(r, g, b));
// if(!mbLastObjWasPolyWithoutLine || !CheckLastPolyLineAndFillMerge(basegfx::B2DPolyPolygon(aSource)))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment