首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >PDF格式的HTML表格

PDF格式的HTML表格
EN

Stack Overflow用户
提问于 2020-04-03 04:18:13
回答 1查看 130关注 0票数 0

我正在尝试使用PDF将HTML打印到JSPdf中。我的桌子有20根柱子。因为这个,我无法打印整张桌子。最后的4-6列总是隐藏起来。是否有任何方式可以显示或删除隐藏的内容?

代码语言:javascript
复制
<div class="table-responsive" >
      <table class="table table-bordered">
        <thead>
          <tr>
            <th>Year Lease</th>
            <th>user Name</th>
            <th>Total Rent</th>
            <th>Other Income</th>
            <th>Total Income</th>
            <th>Avg Expenses at 4 %</th>
            <th>Value Added Expense</th>
            <th>Other Expense</th>
            <th>Total Expense</th>
            <th>NOI</th>
            <th>CAP Rate</th>
            <th>Interest Paid</th>
            <th>Net Income</th>
            <th>Principal</th>
            <th>Yearly Cashflow</th>
            <th>Yearly</th>
            <th>DS Ratio</th>
          </tr>
        </thead>
        <tbody *ngFor="let userInfo of user;index as i">
          <tr>
            <td>Year {{i+1}} Leased</td>
            <td *ngFor="let user of  userInfo.user">{{user.amount | currency}}</td>
            <td>{{user.grossIncome | currency}}</td>
            <td>{{user.otherIncome | currency }}</td>
            <td>{{user.totalIncome | currency }}</td>
            <td>{{user.totalExpense}}</td>
            <td>{{user.valueAddedExpense | currency}}</td>
            <td>{{user.otherExpense  | currency}}</td>
            <td>{{user.totalExpense  | currency}}</td>
            <td>{{user.netOperatingIncome  | currency}}</td>
            <td>{{user.capRate}}% </td>
            <td>{{user.mortageInterest  | currency}}</td>
            <td>{{user.netIncome  | currency}}</td>
            <td>{{user.principle  | currency}}</td>
            <td>{{user.yearlyCashFlow  | currency}}</td>
            <td>{{user.yearly}} %</td>
            <td>{{user.deptServiceRatio}} %</td>
          </tr>
        </tbody>
      </table>
    </div>

TS

代码语言:javascript
复制
 var pdf = new jsPDF('p','pt', 'a3');
    pdf.internal.scaleFactor = 1.40;
    pdf.addHTML(this.print.nativeElement, 0, 0, {
      pagesplit: true
    },  ()=> {
      pdf.save('Report-' + new Date() + '.pdf');
    });

问题

CAP Rate之后还有4列。请帮帮我

EN

回答 1

Stack Overflow用户

发布于 2020-04-03 07:38:24

Y必须像这样设置pdf的高度:

代码语言:javascript
复制
      var width = pdf.internal.pageSize.getWidth();    
      var height = pdf.internal.pageSize.getHeight();
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61005014

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档