Giter VIP home page Giter VIP logo

wuxue107 / bookjs-eazy Goto Github PK

View Code? Open in Web Editor NEW
180.0 7.0 28.0 11.32 MB

web print / html to pdf so eazy ,HTML自动分页插件。用于生成PDF,前端WEB打印生成PDF或后端wkhtmltopdf、chrome headless生成

Home Page: https://www.zhouwuxue.com

License: MIT License

JavaScript 72.16% Batchfile 14.51% Shell 11.38% HTML 1.94%
html2pdf wkhtmltopdf chrome-headless pdf html-pdf printer report-generator webprint pagedjs pdfjs

bookjs-eazy's People

Contributors

wuxue107 avatar yanjiaoguang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

bookjs-eazy's Issues

Blank row when using img

Hello there,

First I wanna say thank you for such an amazing solution to web printing. Secondly, I'm having this problem - when using in I will usually get blank row at the end of the page - here's an example

(pay attention in page number 1 at the bottom)

I wonder if there's any solution to this?

构建表格的过程中出现行丢失的情况

您好,
我在尝试使用Flask作为后端,前端通过bookjs-eazy进行渲染生成PDF的过程中,出现了这样的问题:
当一个表格的长度超过规定的页面长度的时候,表格会自动分页,但是分页的最后一行会丢失(例如,一页可以展示10行表格,我有12行表格需要渲染),那么分页之后第11行会丢失

The exported PDF file is too large

First of all, thanks to the author's plug-in, which has solved many problems! In the process of using, I found that when exporting PDF, the file occupied 600 MB of memory, which is very incredible. Is there any solution to reduce the file size.

使用插件渲染多页表格的时候会出现首行丢失部分数据问题

您好,
我在使用此插件的过程中时(使用Flask作为后端,前端使用基于原生HTML的bookjs-eazy进行渲染)生成PDF的过程中,如果渲染较长表格(超出一页)的时候,每一页表格第一行会出现丢失部分数据的情况,代码案例如下:

我目前用的是最新的版本(1.17.5)
在实现的过程中,我利用了Flask的Jinja2进行渲染:

  1. 我首先定义了表和表头:
<table class="nop-simple-table-2" data-op-type="table">
<thead class="nop-fill-box" style="background: lightgrey">
       <tr>
              <td width="80">名称</td>
             <td width="80">种类</td>
              <td width="100">{{ first_month }}月销量/产量</td>
              <td width="100">{{ second_month }}月销量/产量</td>
              <td width="100">{{ third_month }}月销量/产量</td>
              <td width="100">{{ forth_month }}月销量/产量</td>
              <td width="100">{{ fifth_month }}月销量/产量</td>
              <td width="100">{{ sixth_month }}月销量/产量</td>
       </tr>
</thead>
</table>
  1. 其次,我定义了一个macro,规范表格每一行的格式:
{% macro product_info_row_six_month(product_name, product_type,
                                        sale_1, throughput_1, sale_2, throughput_2, sale_3, throughput_3,
                                        sale_4, throughput_4, sale_5, throughput_5, sale_6, throughput_6) %}
<tr style="background: antiquewhite">
    <td data-split-repeat="true">{{ product_name }}</td>
    <td><b style="color: blue">{{ product_type }}</b></td>
    <td><b style="font-size: 6pt">{{ sale_1 }}</b>/{{ throughput_1 }}</td>
    <td><b style="font-size: 6pt">{{ sale_2 }}</b>/{{ throughput_2 }}</td>
    <td><b style="font-size: 6pt">{{ sale_3 }}</b>/{{ throughput_3 }}</td>
    <td><b style="font-size: 6pt">{{ sale_4 }}</b>/{{ throughput_4 }}</td>
    <td><b style="font-size: 6pt">{{ sale_5 }}</b>/{{ throughput_5 }}</td>
    <td><b style="font-size: 6pt">{{ sale_6 }}</b>/{{ throughput_6 }}</td>
</tr>
{% endmacro %}
  1. 在此基础上,我通过for循环实现了加载每一行。渲染后,会出现如下的结果:
    image-1718177590532

可以看到,每一页的第一行会丢失部分数据(在此例中丢失的是产量字段,但是对销量字段没有影响)。

同时,我还测试了一下,如果每一个中只渲染销量字段或者产量字段,则不会产生上面的问题。

能否麻烦您帮忙看看我该如何解决这个问题?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.