TCPDF 设置固定边框

发布于 2024-11-14 03:29:19 字数 3066 浏览 4 评论 0原文

我正在使用 tcpdf 使用 PHP 将 HTML 转换为 PDF。

请在此处查看以下给定内容的输出。

在此处输入图像描述

<div style="text-indent: -76.5pt; margin: 0in 54.9pt 0pt 76.5pt;"><strong><span style="font-size: small;"><span style="text-transform: uppercase;">Motion with Constant Acceleration</span></span></strong>&nbsp;</div>
<p style="text-indent: -76.5pt; margin: 0in 54.9pt 0pt 76.5pt;"><span style="text-transform: uppercase;">Overview<br />
</span><br />
The concepts of displacement, velocity, and acceleration are very important to master.&nbsp;The study of acceleration provides an important link between kinematics (the study of motion) and dynamics (the study of the causes of motion).&nbsp;The study of acceleration also plays a key role in understanding such concepts as gravity, circular motion, harmonic motion, electricity and magnetism. The simplest case of acceleration to analyze mathematically is that for an object moving with a constant acceleration. This is the situation for any object experiencing a constant force.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</p>
<div style="text-indent: -76.5pt; margin: 0in 54.9pt 0pt 76.5pt;" class="rteindent1">
<div style="text-indent: -76.5pt;"><span style="font-size: 9pt;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1.&nbsp;&nbsp; You will measure the position of at&nbsp;various&nbsp;time intervals as it moves down an&nbsp; inclined track due to the force of &nbsp;&nbsp;&nbsp;&nbsp;gravity. A tape timer will be used to measure time intervals of 0.1 s and the corresponding displacement in position.</span></div>
<div style="text-indent: -76.5pt;">&nbsp;</div>
<div style="text-align: justify; text-indent: -13.5pt;"><span style="font-size: 9pt;">2. Next, you will determine the average&nbsp;&nbsp; velocity and time for several points along the carts path of motion from the tape timer data.</span></div>
<div style="text-indent: -76.5pt;">&nbsp;</div>
<div style="text-align: justify; text-indent: -13.5pt;"><span style="font-size: 9pt;">3. Finally, you will determine the acceleration of the cart down the track from a plot of the average velocity vs. time. Using trigonometric principles, you will verify that the acceleration is due to the force of gravity.</span></div>
</div>

请注意输出内容超出了边框。我发现通过提供 text-indent:-76px 样式会发生这种情况。 即使*如果我提供该样式*内容也不应该超出页面...应该采取什么措施来解决这个问题?

提前致谢....

I am converting a HTML in PDF using tcpdf using PHP.

Kindly view the output here for the below given content.

enter image description here

<div style="text-indent: -76.5pt; margin: 0in 54.9pt 0pt 76.5pt;"><strong><span style="font-size: small;"><span style="text-transform: uppercase;">Motion with Constant Acceleration</span></span></strong> </div>
<p style="text-indent: -76.5pt; margin: 0in 54.9pt 0pt 76.5pt;"><span style="text-transform: uppercase;">Overview<br />
</span><br />
The concepts of displacement, velocity, and acceleration are very important to master. The study of acceleration provides an important link between kinematics (the study of motion) and dynamics (the study of the causes of motion). The study of acceleration also plays a key role in understanding such concepts as gravity, circular motion, harmonic motion, electricity and magnetism. The simplest case of acceleration to analyze mathematically is that for an object moving with a constant acceleration. This is the situation for any object experiencing a constant force.                   </p>
<div style="text-indent: -76.5pt; margin: 0in 54.9pt 0pt 76.5pt;" class="rteindent1">
<div style="text-indent: -76.5pt;"><span style="font-size: 9pt;">                        1.   You will measure the position of at various time intervals as it moves down an  inclined track due to the force of     gravity. A tape timer will be used to measure time intervals of 0.1 s and the corresponding displacement in position.</span></div>
<div style="text-indent: -76.5pt;"> </div>
<div style="text-align: justify; text-indent: -13.5pt;"><span style="font-size: 9pt;">2. Next, you will determine the average   velocity and time for several points along the carts path of motion from the tape timer data.</span></div>
<div style="text-indent: -76.5pt;"> </div>
<div style="text-align: justify; text-indent: -13.5pt;"><span style="font-size: 9pt;">3. Finally, you will determine the acceleration of the cart down the track from a plot of the average velocity vs. time. Using trigonometric principles, you will verify that the acceleration is due to the force of gravity.</span></div>
</div>

Kindly see that in the output contents are out of the border. I find out that by giving text-indent:-76px style this is happening. Even *if i give that style* content should not go out of the page... Wat should be done to resolve this issue?

Thanks in advance....

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

呆头 2024-11-21 03:29:19

似乎忽略了边距。
您是否尝试过像这样指定所有边距(有时 TCPDF 倾向于忽略某些内容):

margin-top: 0in;
margin-right: 54.9pt;
etc...

我想到的另一件事是:您确定 TCPDF 支持 0in 作为表示法吗?您是否尝试将其更改为 0pt?

It seems to be ignoring the margin.
have you tried specifing all margins like this (sometimes TCPDF tends to ignore things):

margin-top: 0in;
margin-right: 54.9pt;
etc...

Another thing that comes to my mind: are you sure that TCPDF supports 0in as a notation?Have you tried changing that to 0pt?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文