Copy link to clipboard
Copied
Hi again! 🙂
I just converted a PDF into an indesign file, but I noticed it came with a bunch of section breaks — the page numbering restarts every 1, 2 or 3 pages. I've selected all pages and tried to override the sections by starting a whole new section in "numbering and section options" but it just affected the first section/the first two pages.
By any chance, does anyone know a good workaround so that it won't be necessary to manually reset all the sections one by one, not in this nor in future converted documents, please?
This JavaScript will successfully remove extra section markers:
/**
* Remove all section numbering and section markers
* except for the first page in the active InDesign document.
* Works in InDesign 2026.
*/
(function () {
if (app.documents.length === 0) {
alert("Please open a document first.");
return;
}
var doc = app.activeDocument;
var sections = doc.sections;
if (sections.length === 0) {
alert("No sections found in this document.");
...
Copy link to clipboard
Copied
This JavaScript will successfully remove extra section markers:
/**
* Remove all section numbering and section markers
* except for the first page in the active InDesign document.
* Works in InDesign 2026.
*/
(function () {
if (app.documents.length === 0) {
alert("Please open a document first.");
return;
}
var doc = app.activeDocument;
var sections = doc.sections;
if (sections.length === 0) {
alert("No sections found in this document.");
return;
}
// Keep only the first section; remove all others
for (var i = sections.length - 1; i >= 1; i--) {
try {
sections[i].remove();
} catch (e) {
$.writeln("Error removing section: " + e);
}
}
// Reset the first section’s properties to make sure it’s clean and intact
var firstSection = sections[0];
firstSection.continueNumbering = false;
firstSection.pageNumberStart = 1;
firstSection.sectionPrefix = "";
firstSection.marker = "";
firstSection.includeSectionPrefix = false;
alert("All section numbering and markers removed except on the first page. And Mike says hello.");
})();
Copy link to clipboard
Copied
Hello Mike! Works perfectly!
Thank you so much!
Copy link to clipboard
Copied
You are welcome!
Copy link to clipboard
Copied
Just for future reference, by default whenever you open the Numbering and Section Options dialog box (Layout>Numbering and Sections Options... menu command), you may find that it automatically creates a new section on whatever page is selected in the Pages panel.
If it's the first page in the document, the Start Section check box is grayed out. But on any other page in the document, that Start Section check box will be live and it will be checked. Whether you want to start a new section or not. So the last thing you want to do before you leave that dialog box is make sure that the Start Section check box is unchecked before you exit the dialog box. Or you may end up with that new section and restarting your page numbering, again, whether you want it or not.
Hope this helps,
Randy
Find more inspiration, events, and resources on the new Adobe Community
Explore Now