默认代码
  
        var doc = new jsPDF('p', 'pt', 'a4', false);
        doc.setFontSize(40);
        doc.setDrawColor(0);
        doc.setFillColor(238, 238, 238);
        doc.rect(0, 0, 595.28, 841.89, 'F');
        doc.text(35, 100, type);
        doc.addImage(imgData, format, 100, 200, 280, 210, undefined, compress);
        doc.save(type + '.pdf')
查看源码
 
   
   if (orientation) {
        switch (orientation.substr(0, 1)) {
          case 'l':
            if (height > width) orientation = 's';
            break;
          case 'p':
            if (width > height) orientation = 's';
            break;
        }
        if (orientation === 's') {
          tmp = width;
          width = height;
          height = tmp;
        }
      }
更改代码
 var doc = new jsPDF('l', 'pt', 'a4', false);
         
        
            
                作者
                
                
                    xiaoyierle
                
                发表于
                2021-05-18 00:04:54
                
                ,添加在分类
                
                
                    技术
                
                
                下
                
                
                ,并被添加「
                
                
                    jspdf
                
                
                 」标签
                
                ,最后修改于
                2021-05-18 00:07:09
            
            
         
    
Comments