@@ -245,35 +245,50 @@ generatePdf(p){
245245
246246 };*/
247247
248-
249- const documentDefinition = { header : 'date:' + "\n" + this . formattedDate , content :[
250- { text : 'Order Details'
251- } ,
252- {
253- table : {
254- headerRows : 1 ,
255- widths : [ '*' , 'auto' , 'auto' , 'auto' ] ,
256- body : [
257- [ 'Resto' , 'Name plat' , 'Name Category' ] ,
258- [ p . resto , p . name , p . categorie ]
259-
260-
261- ]
262-
263-
264- }
265- }
266- ] ,
267-
268-
269-
270-
271- } ;
272-
273-
274-
275-
276-
248+ var documentDefinition = {
249+ footer : "Restaurant CHEW & CHEER by Takwa zayene " ,
250+ header : 'date:' + "\n" + this . formattedDate ,
251+ content : [ { text :
252+ 'Order Details :' ,
253+ color : '#047886' ,
254+ style : 'sectionHeader'
255+ } ,
256+ {
257+ columns : [
258+ {
259+ // auto-sized columns have their widths based on their content
260+ width : 'auto' ,
261+ text : 'Nom restaurant : ' + "\n \n " + p . resto
262+ } ,
263+ {
264+ // star-sized columns fill the remaining space
265+ // if there's more than one star-column, available width is divided equally
266+ width : 'auto' ,
267+ text : "Nom plat demander : " + "\n \n" + p . name
268+ } ,
269+
270+ {
271+ // % width
272+ width : 'auto' ,
273+ text : "Categorie : " + "\n" + p . categorie
274+ } ,
275+ ] ,
276+ // optional space between columns
277+ columnGap : 60
278+ } ,
279+
280+ ]
281+ , styles : {
282+ sectionHeader : {
283+ bold : true ,
284+ decoration : 'underline' ,
285+ fontSize : 14 ,
286+ margin : [ 0 , 15 , 0 , 15 ] ,
287+ color : '#047886' ,
288+
289+ }
290+ }
291+ } ;
277292
278293 pdfMake . createPdf ( documentDefinition ) . open ( ) ;
279294 pdfMake . createPdf ( documentDefinition ) . download ( ) ;
0 commit comments