如何在特定高度动态添加空格、分隔符或 div?
所以基本上我想从 React 应用程序打印一个 pdf 页面,其中包含多个组件。组件的数量从 4 个增加到 12 个,组件的高度也会根据商店的内容而变化。
我需要每隔 900 像素(a4 页面的大小)添加一个空格,这样所有组件都不会在页面之间分割。或者根据渲染的组件数量将孔页面分割成 900 像素的部分。
So basically I want to print out a page as a pdf from a react app, that include multiple components. number of components change from 4 up to 12 and the height of the components also change based on content from the store.
I need every 900px(size of my a4 page) to add a space so that none of the components get split between pages. or to split the hole page in to even 900px parts based on how many components are rendered.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这不是一个可以用代码片段来回答的问题。我将解释我将如何解决这个问题。
打印事件之后的步骤(单击按钮或自动...)
例如,我们说:
This is not a question can be answered with code snippet. I will explain how i would tackle with this problem.
Steps right after the the print event (on button click or automated...)
E.g. Let's say: