2. Given $\triangle A B C$ with side lengths $a=17, b=18, c$ $=19$, a point $O$ inside $\triangle A B C$ is drawn perpendiculars to the three sides of $\triangle A B C$, intersecting at points $D$, $E$, and $F$, such that $B D+C E+A F=27$. Then $B D+B F$ $=$ $\qquad$
2.18.

As shown in Figure 5, let \( BD = x \), \( CE = y \), \( AF = z \). Then
\[
\begin{array}{l}
CD = 17 - x, \\
AE = 18 - y, \\
BF = 19 - z.
\end{array}
\]

Connect \( OA \), \( OB \), \( OC \).
In right triangles \( \triangle OBD \), \( \triangle OCE \), \( \triangle OAF \),
\[
\left\{\begin{array}{l}
x^{2} + OD^{2} = (19 - z)^{2} + OF^{2}, \\
y^{2} + OE^{2} = (17 - x)^{2} + OD^{2}, \\
z^{2} + OF^{2} = (18 - y)^{2} + OE^{2}, \\
x + y + z = 27.
\end{array}\right.
\]
\[
\begin{array}{l}
\text{(1) } + \text{ (2) } + \text{ (3) gives } \\
x^{2} + y^{2} + z^{2} = (17 - x)^{2} + (18 - y)^{2} + (19 - z)^{2}. \\
\text{ Hence } \left\{\begin{array}{l}
17x + 18y + 19z = 487, \\
y = 27 - x - z.
\end{array}\right.
\end{array}
\]

Solving, we get \( x - z = -1 \).
Therefore, \( BD + BF = x + 19 - z = 18 \).