Fix bug 74364

This commit is contained in:
Svetlana Kulikova
2025-05-07 13:12:48 +03:00
parent a1ff4a8de2
commit cb34481460
3 changed files with 17 additions and 1 deletions

View File

@ -1555,6 +1555,7 @@ bool CPdfEditor::SplitPages(const int* arrPageIndex, unsigned int unLength, PDFD
PDFDoc* pPDFDocument = _pDoc;
XRef* xref = pPDFDocument->getXRef();
PdfWriter::CDocument* pDoc = m_pWriter->GetDocument();
int nPagesBefore = m_pReader->GetNumPagesBefore(pPDFDocument);
if (unLength == 0)
unLength = pPDFDocument->getNumPages();
@ -1570,7 +1571,7 @@ bool CPdfEditor::SplitPages(const int* arrPageIndex, unsigned int unLength, PDFD
PdfWriter::CPage* pPage = new PdfWriter::CPage(pDoc);
pDoc->AddObject(pPage);
pDoc->AddPage(pDoc->GetPagesCount(), pPage);
pDoc->AddEditPage(pPage, arrPageIndex ? arrPageIndex[i] : i);
pDoc->AddEditPage(pPage, nPagesBefore + (arrPageIndex ? arrPageIndex[i] : i));
// Получение объекта страницы
Object pageRefObj, pageObj;