PDF Export Styles
PDF Export Styles
Andreas S.
Posts: 208Questions: 74Answers: 4
in Buttons
I want to style the exported pdf. in the console.log(doc) I see some styled named tabelHeader,...
Is it possible to change these settings?
I tried with
customize: function(doc){
styles: {
tableHeader:{
fillColor:"#F0F8FF"
}
}
But this did not work.
Andreas
This question has an accepted answers - jump to answer
This discussion has been closed.
Answers
try to unminify the buttons.html5.min.js It has a clean JSON alike structure.
here is the field:
styles: {
tableHeader: {
bold: 0,
fontSize: 11,
color: "#595959",
alignment: "left"
},
You don't need to unminify the file - the source code is freely available!
The Buttons PDF export uses pdfmake for the export - you would need to refer to their documentation for information on how to customise the styling using their APIs.
Allan
Sorry I have some Problems with these. I think I set the vars not correct.
I do following:
I think I set it correct, but I get following error:
I have no idea how can I set it and the table will print to the document.
Andreas
I'm afraid you'd need to ask in the pdfmake support channels. I really can't help with their API as I'm not an expert in it.
Allan
I needed to align PDF the table to the center I edited PDFMAKE.MIN.JS
var y=e.text.match(c),w=e.text.match(f);e.leadingCut=y?m.widthOfString(y[0],i):0,e.trailingCut=w?m.widthOfString(w[0],i):0,e.alignment=h(e,n,"alignment","center")
Changing only the center to get what i needed.
NOTE:
I had changed every COLUMN CLASS to give it the css style i wanted but they never exported.
hope this puts you on the right track.
AS gabrielandre got me there with his comment.