Commit c1280274 by ramdayalmunda

added fontColor on PDF

parent 686178f5
...@@ -15,6 +15,12 @@ ...@@ -15,6 +15,12 @@
padding: 3px; padding: 3px;
cursor:default; cursor:default;
} }
.a-doc-editor .dropdown-label {
display: flex;
flex-direction: column;
text-align: center;
justify-content: center;
}
.a-doc-editor .dropdown-list { .a-doc-editor .dropdown-list {
display: none; display: none;
position: absolute; position: absolute;
...@@ -88,8 +94,6 @@ ...@@ -88,8 +94,6 @@
cursor: pointer; cursor: pointer;
} }
.a-doc-editor .footer { .a-doc-editor .footer {
overflow: auto; overflow: auto;
background-color: #91d8bd; background-color: #91d8bd;
......
...@@ -26,7 +26,6 @@ var ADocEditor = function (customConfig) { ...@@ -26,7 +26,6 @@ var ADocEditor = function (customConfig) {
var fontColorLabel; var fontColorLabel;
var fontBold; var fontBold;
var fontItalic; var fontItalic;
var fontUnderline;
var fullScreenLoadingOverlay; var fullScreenLoadingOverlay;
var defaultConfig = { var defaultConfig = {
...@@ -140,9 +139,6 @@ var ADocEditor = function (customConfig) { ...@@ -140,9 +139,6 @@ var ADocEditor = function (customConfig) {
<div class="option" ade-action="font-italic"> <div class="option" ade-action="font-italic">
<div class="option-button"><em>I</em></div> <div class="option-button"><em>I</em></div>
</div> </div>
<div class="option" ade-action="font-underline">
<div class="option-button"><u>U</u></div>
</div>
</div> </div>
</div> </div>
...@@ -242,8 +238,6 @@ var ADocEditor = function (customConfig) { ...@@ -242,8 +238,6 @@ var ADocEditor = function (customConfig) {
fontBold.addEventListener('click', toggleBold) fontBold.addEventListener('click', toggleBold)
fontItalic = container.querySelector('[ade-action="font-italic"]') fontItalic = container.querySelector('[ade-action="font-italic"]')
fontItalic.addEventListener('click', toggleItalic) fontItalic.addEventListener('click', toggleItalic)
fontUnderline = container.querySelector('[ade-action="font-underline"]')
fontUnderline.addEventListener('click', toggleUnderline)
fullScreenLoadingOverlay = document.createElement('div') fullScreenLoadingOverlay = document.createElement('div')
fullScreenLoadingOverlay.innerText = 'Loading...' fullScreenLoadingOverlay.innerText = 'Loading...'
...@@ -809,7 +803,7 @@ var ADocEditor = function (customConfig) { ...@@ -809,7 +803,7 @@ var ADocEditor = function (customConfig) {
y: (config.pageSetup.canvasHeight - y) / config.pageSetup.canvasMultiplier, y: (config.pageSetup.canvasHeight - y) / config.pageSetup.canvasMultiplier,
size: (style.fontSize * config.pageSetup.fontMultiplier) / config.pageSetup.canvasMultiplier, size: (style.fontSize * config.pageSetup.fontMultiplier) / config.pageSetup.canvasMultiplier,
font: embededFonts[style.fontFamily], font: embededFonts[style.fontFamily],
color: rgb(0, 0, 0), color: rgb( ...getRgbArrayFromHex( style.fontColor ) ),
}) })
} }
...@@ -827,7 +821,7 @@ var ADocEditor = function (customConfig) { ...@@ -827,7 +821,7 @@ var ADocEditor = function (customConfig) {
y: (config.pageSetup.canvasHeight - style.y) / config.pageSetup.canvasMultiplier, y: (config.pageSetup.canvasHeight - style.y) / config.pageSetup.canvasMultiplier,
size: (style.fontSize * config.pageSetup.fontMultiplier) / config.pageSetup.canvasMultiplier, size: (style.fontSize * config.pageSetup.fontMultiplier) / config.pageSetup.canvasMultiplier,
font: embededFonts[style.fontFamily], font: embededFonts[style.fontFamily],
color: rgb(0, 0, 0), color: rgb( ...getRgbArrayFromHex( style.fontColor ) ),
}) })
setData.formatedText[c].x = x setData.formatedText[c].x = x
setData.formatedText[c].y = y setData.formatedText[c].y = y
...@@ -852,6 +846,17 @@ var ADocEditor = function (customConfig) { ...@@ -852,6 +846,17 @@ var ADocEditor = function (customConfig) {
hideLoader() hideLoader()
} }
function getRgbArrayFromHex(hexString){
let rgbArr= [ 0,0,0 ]
if (hexString.length==4 || hexString.length==5){
rgbArr = [ parseInt(hexString[1], 16)/15, parseInt(hexString[2], 16)/15, parseInt(hexString[3], 16)/15 ]
}else if (hexString.length==7 || hexString.length==9){
rgbArr = [ parseInt(hexString.slice(1,3), 16)/255, parseInt(hexString.slice(3,5), 16)/255, parseInt(hexString.slice(5,7), 16)/255 ]
}
return rgbArr
}
function addFonts(paths, name) { function addFonts(paths, name) {
if (typeof paths == 'string') paths = [paths] if (typeof paths == 'string') paths = [paths]
let fontObj = { let fontObj = {
...@@ -940,9 +945,6 @@ var ADocEditor = function (customConfig) { ...@@ -940,9 +945,6 @@ var ADocEditor = function (customConfig) {
caretData.activeData.style.italic = !isItalic caretData.activeData.style.italic = !isItalic
} }
} }
function toggleUnderline(e){
console.log('underline', fontUnderline)
}
function focusLastCanvas(){ function focusLastCanvas(){
if (!lastFocusCanvas) lastFocusCanvas = canvasList[0].el if (!lastFocusCanvas) lastFocusCanvas = canvasList[0].el
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment