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

Delete pages with specific names

New Here ,
Jan 04, 2023 Jan 04, 2023

Copy link to clipboard

Copied

Hello! I have a huge form PDF. Each page is numbered with a suffix, e.g. "3001.FK...". Can a script be used to delete all pages whose name begins with a specific ID? So here, for example, "3001"? Currently I do this in the script for each individual page. However, maintaining the code is extremely time-consuming.

TOPICS
JavaScript

Views

157

Translate

Translate

Report

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 ,
Jan 04, 2023 Jan 04, 2023

Copy link to clipboard

Copied

LATEST

Yes, this is possible. You can examine each page's label ("name") using the getPageLabel method, and then delete it using the deletePages method. You can do it in a loop to examine all the pages in the file. However, you should start the loop from the last page in the file and work your way backwards to the first one for it to work correctly.

Votes

Translate

Translate

Report

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