How to convert html table to pdf using pdfmake

后端 未结 2 1223
旧巷少年郎
旧巷少年郎 2020-12-22 12:53

Am trying to convert my html table to pdf using pdfmake http://pdfmake.org/ but i cant make it to how to use





        
2条回答
  •  星月不相逢
    2020-12-22 13:35

    1.You cannot put HTML table in content of document definition object when using PDFMAKE 2.What you need to do is generate an array of arrays. The main array is body array in table object in document definition object.So now extract each row of your html table wise and push each cell (row-wise) into an array..after the row is finished and all cell data of particular row is pushed into the body array.This needs to be done for all rows.That's it! A simple example is

    
        
            
            HTML Page setup Tutorial 
            
            
            
        
    
    
    
    
    
    

提交回复
热议问题