Example 2. The lengths of the three sides of $\triangle ABC$ are $BC=17$, $CA=18$, and $AB=19$. Through a point $P$ inside $\triangle ABC$, perpendiculars $PD$, $PE$, and $PF$ are drawn to the three sides of $\triangle ABC$ ($D$, $E$, and $F$ are the feet of the perpendiculars), and $BD + CE + AF = 27$. Find the length of $BD + BF$. (5th National Junior High School Mathematics Correspondence Competition)
Let $B D=x, B F=y$. Then $C D=17-x$, $A F=19-2$. Also, $B D+C E+A F=27$, so
$$
\begin{array}{l}
C E=27-B D-A F=8-x+y, \\
A B=18-C E=10+x-y .
\end{array}
$$

By Theorem 1 conclusion (2), we have
$$
\begin{array}{l}
x^{2}+(8-x+y)^{2}+(19-y)^{2} \\
=(17-x)^{2}+(10+x-y)^{2}+y^{2} .
\end{array}
$$

Simplifying, we get $2 x+2 y=8^{2}+19^{2}-17^{2}-10^{2}$. Therefore, $B D+B F=18$.