Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Clear/Delete/Override section numbering in a document made from a converted PDF

Explorer ,
Nov 04, 2025 Nov 04, 2025

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? 

TOPICS
How to
64
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Nov 04, 2025 Nov 04, 2025

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.");
       
...
Translate
Community Expert ,
Nov 04, 2025 Nov 04, 2025

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.");
})();
Mike Witherell
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Nov 04, 2025 Nov 04, 2025

Hello Mike! Works perfectly! 

Thank you so much!

 

Screenshot 2025-11-04 at 20.52.06.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 05, 2025 Nov 05, 2025
LATEST

You are welcome!

Mike Witherell
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Nov 04, 2025 Nov 04, 2025

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines