6. In rectangle $A B C D$, points $E$ and $F$ are on sides $B C$ and $C D$ respectively, and satisfy $A E=A F$. If $S_{\triangle A D F}=2$, $S_{\triangle A B E}=4$, and $S_{\triangle C E F}=8$, then the value of $7 \cos \angle E A F$ is ( ).
(A) 2
(B) 3
(C) 4
(D) 5
6. B.
$$
\begin{array}{l}
\text { Let } \angle E A F=\theta, A B=C D=a, \\
B C=A D=b, B E=x, F D=y .
\end{array}
$$

Then $a x=8, b y=4,(a-y)(b-x)=16$.
Thus $a b+x y=28$.
As shown in Figure 2, rotate $\triangle A B E$ around point $A$,
so that $A E$ coincides with $A F$,
and let the new position of point $B$ be point $G$.
$$
\begin{array}{l}
\text { Therefore, } A G=a, \\
F G=x .
\end{array}
$$

Notice that,
$$
\begin{array}{l}
\angle G A D=90^{\circ}-\theta, \angle G F D=90^{\circ}+\theta . \\
\text { Then } S_{\text {quadrilateral } A G F D}=S_{\triangle A G D}+S_{\triangle G F D} \\
=\frac{1}{2} a b \sin \angle G A D+\frac{1}{2} x y \sin \angle G F D \\
=\frac{1}{2}(a b+x y) \cos \theta \\
\Rightarrow \cos \theta=\frac{3}{7} .
\end{array}
$$