diff --git a/EpubFile/src/CEpubFile.cpp b/EpubFile/src/CEpubFile.cpp index 1a275b07fe..794981d982 100644 --- a/EpubFile/src/CEpubFile.cpp +++ b/EpubFile/src/CEpubFile.cpp @@ -111,6 +111,7 @@ HRESULT CEpubFile::Convert(const std::wstring& sInputFile, const std::wstring& s oFileParams.SetTitle(m_oBookInfo.GetTitle()); oFileParams.SetDate(m_oBookInfo.GetDate()); oFileParams.SetDescription(m_oBookInfo.GetDescriptions()); + oFileParams.SetPageBreakBefore(true); std::wstring sDocxFileTempDir = m_sTempDir + L"/tmp"; NSDirectory::CreateDirectory(sDocxFileTempDir); diff --git a/HtmlFile2/htmlfile2.cpp b/HtmlFile2/htmlfile2.cpp index ea92587f25..d800f10e55 100644 --- a/HtmlFile2/htmlfile2.cpp +++ b/HtmlFile2/htmlfile2.cpp @@ -1605,7 +1605,8 @@ HRESULT CHtmlFile2::OpenBatchHtml(const std::vector& sSrc, const s // Переходим в начало if(m_internal->m_oLightReader.MoveToStart()) { - m_internal->PageBreakBefore(); + if(oParams && oParams->m_bNeedPageBreakBefore) + m_internal->PageBreakBefore(); m_internal->readSrc(); m_internal->m_oLightReader.Clear(); m_internal->m_sBase.clear(); diff --git a/HtmlFile2/htmlfile2.h b/HtmlFile2/htmlfile2.h index 94372a5eec..951631e611 100644 --- a/HtmlFile2/htmlfile2.h +++ b/HtmlFile2/htmlfile2.h @@ -19,6 +19,12 @@ struct CHtmlParams std::wstring m_sBookTitle; // Название std::wstring m_sDate; // Дата std::wstring m_sDescription; // описание + bool m_bNeedPageBreakBefore; // Новый html с новой страницы + + void SetPageBreakBefore(bool bNeed) + { + m_bNeedPageBreakBefore = bNeed; + } void SetDate(const std::wstring& sDate) {