Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
sdkjs
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boris Kocherov
sdkjs
Commits
d6beb4d7
Commit
d6beb4d7
authored
Jul 20, 2017
by
Oleg Korshul
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
watermark: slides
parent
6f0b3862
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
1 deletion
+40
-1
common/apiCommon.js
common/apiCommon.js
+14
-1
slide/Drawing/DrawingDocument.js
slide/Drawing/DrawingDocument.js
+20
-0
slide/Drawing/HtmlPage.js
slide/Drawing/HtmlPage.js
+6
-0
No files found.
common/apiCommon.js
View file @
d6beb4d7
...
...
@@ -3187,6 +3187,7 @@
this
.
transparent
=
0.3
;
this
.
zoom
=
1
;
this
.
calculatezoom
=
-
1
;
this
.
CheckParams
=
function
(
api
)
{
...
...
@@ -3195,6 +3196,11 @@
this
.
Generate
=
function
()
{
if
(
this
.
zoom
==
this
.
calculatezoom
)
return
;
this
.
calculatezoom
=
this
.
zoom
;
var
content
=
this
.
inputContentSrc
;
for
(
var
key
in
this
.
replaceMap
)
{
...
...
@@ -3238,7 +3244,14 @@
this
.
StartRenderer
=
function
()
{
this
.
imageBase64
=
this
.
image
.
toDataURL
(
"
image/png
"
);
var
canvasTransparent
=
document
.
createElement
(
"
canvas
"
);
canvasTransparent
.
width
=
this
.
image
.
width
;
canvasTransparent
.
height
=
this
.
image
.
height
;
var
ctx
=
canvasTransparent
.
getContext
(
"
2d
"
);
ctx
.
globalAlpha
=
this
.
transparent
;
ctx
.
drawImage
(
this
.
image
,
0
,
0
);
this
.
imageBase64
=
canvasTransparent
.
toDataURL
(
"
image/png
"
);
canvasTransparent
=
null
;
};
this
.
EndRenderer
=
function
()
{
...
...
slide/Drawing/DrawingDocument.js
View file @
d6beb4d7
...
...
@@ -1161,10 +1161,15 @@ function CDrawingDocument()
}
this
.
ToRendererPart
=
function
()
{
var
watermark
=
this
.
m_oWordControl
.
m_oApi
.
watermarkDraw
;
var
pagescount
=
this
.
SlidesCount
;
if
(
-
1
==
this
.
m_lCurrentRendererPage
)
{
if
(
watermark
)
watermark
.
StartRenderer
();
this
.
m_oDocRenderer
=
new
AscCommon
.
CDocumentRenderer
();
this
.
m_oDocRenderer
.
VectorMemoryForPrint
=
new
AscCommon
.
CMemory
();
this
.
m_lCurrentRendererPage
=
0
;
...
...
@@ -1185,6 +1190,9 @@ function CDrawingDocument()
renderer
.
BeginPage
(
this
.
m_oLogicDocument
.
Width
,
this
.
m_oLogicDocument
.
Height
);
this
.
m_oLogicDocument
.
DrawPage
(
i
,
renderer
);
renderer
.
EndPage
();
if
(
watermark
)
watermark
.
DrawOnRenderer
(
renderer
,
this
.
m_oLogicDocument
.
Width
,
this
.
m_oLogicDocument
.
Height
);
}
if
(
end
==
-
1
)
...
...
@@ -1197,6 +1205,9 @@ function CDrawingDocument()
if
(
this
.
m_lCurrentRendererPage
>=
pagescount
)
{
if
(
watermark
)
watermark
.
EndRenderer
();
this
.
m_lCurrentRendererPage
=
-
1
;
this
.
m_oDocRenderer
=
null
;
this
.
m_oWordControl
.
m_oApi
.
ShowParaMarks
=
this
.
m_bOldShowMarks
;
...
...
@@ -5489,6 +5500,9 @@ function CSlideDrawer()
h_px
=
this
.
CachedCanvas
.
height
;
outputCtx
.
drawImage
(
this
.
CachedCanvas
,
0
,
0
,
w_px
,
h_px
,
(
_x
>>
0
)
-
this
.
SlideEps
,
(
_y
>>
0
)
-
this
.
SlideEps
,
w_px
,
h_px
);
if
(
this
.
m_oWordControl
.
m_oApi
.
watermarkDraw
)
this
.
m_oWordControl
.
m_oApi
.
watermarkDraw
.
Draw
(
outputCtx
,
w_px
,
h_px
);
}
else
{
...
...
@@ -5503,6 +5517,9 @@ function CSlideDrawer()
h_px_src
=
this
.
CachedCanvas
.
height
;
outputCtx
.
drawImage
(
this
.
CachedCanvas
,
0
,
0
,
w_px_src
,
h_px_src
,
(
_x
>>
0
)
-
this
.
SlideEps
,
(
_y
>>
0
)
-
this
.
SlideEps
,
w_px
,
h_px
);
if
(
this
.
m_oWordControl
.
m_oApi
.
watermarkDraw
)
this
.
m_oWordControl
.
m_oApi
.
watermarkDraw
.
Draw
(
outputCtx
,
w_px
,
h_px
);
}
}
else
...
...
@@ -5531,6 +5548,9 @@ function CSlideDrawer()
g
.
IsNoDrawingEmptyPlaceholderText
=
true
;
this
.
m_oWordControl
.
m_oLogicDocument
.
DrawPage
(
slideNum
,
g
);
if
(
this
.
m_oWordControl
.
m_oApi
.
watermarkDraw
)
this
.
m_oWordControl
.
m_oApi
.
watermarkDraw
.
Draw
(
outputCtx
,
w_px
,
h_px
);
}
}
}
...
...
slide/Drawing/HtmlPage.js
View file @
d6beb4d7
...
...
@@ -3145,6 +3145,12 @@ function CEditorPage(api)
if
(
this
.
MobileTouchManager
)
this
.
MobileTouchManager
.
Resize
();
if
(
this
.
m_oApi
.
watermarkDraw
)
{
this
.
m_oApi
.
watermarkDraw
.
zoom
=
this
.
m_nZoomValue
/
100
;
this
.
m_oApi
.
watermarkDraw
.
Generate
();
}
};
this
.
CheckCalculateDocumentSize
=
function
(
_bounds
)
...
...
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