# LateX minted code in two pages

I use minted in LateX. My code in Python is too big, and one page is too little. I need to split my code for two pages. I know that minted has not auto wrap pages. So I tried this:

    \begin{mdframed}[linecolor=black, topline=true, bottomline=true,
leftline=false, rightline=false,
backgroundcolor=lbcolor,userdefinedwidth=\textwidth]
\inputminted[breaklines = true, frame=lines, framesep=2mm,
baselinestretch=1.2, bgcolor=LightGray, fontsize=\footnotesize, linenos]
{Python}{media/KodyProgramow/kod.py}
\end{mdframed}


But pdflatex gets loop with:

Overfull \vbox ( [This number is changing] is too high ).

I think I need have hand-made split (somethinh like starline=15, endline=40), but I don't know how to make this. I have to read code from file.

The bgcolor option for minted is not compatible with page breaks. You should use mdframed to provide a background color instead, since it can break across pages. Depending on what you want, it may be best to make all of the frame lines with mdframed.