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

PDF separate pages with (3 digit) page number prefix...? (Like PDF Bee!)

Contributor ,
Dec 13, 2018 Dec 13, 2018

Copy link to clipboard

Copied

I updated OS X to 10.13.6 and was quit shocked to discover I can't use PDF Bee anymore... I use PDF Bee to make separate PDF's of all the pages in my InDesign documents with the page number as a prefix in THREE numbers.

Now I know that InDesign can export pdf's as separate pages but it can only add the page number at the end... not good for my use. Another problem is that it adds the numbers like (for instance) 1, 43, 121 and not 001, 043 and 121 (so always with three digits).

I also know Acrobat can split pdf's and add a number in front of the PDF file but 1. it does not use the actual page number (it just numbers the PDF's chronologically) and 2. it also simply adds 1, 43, 121 and not 001, 034, 121.

So... I'm screwed! I have to create hundreds of PDF's every week with the EXACT page number in three digits in front of the file name but I can't find any way to get that done right now. HELP!

Anyone knows about a script that can do this? (PDF Bee is a fancy script, after all.)

Views

5.2K

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

correct answers 1 Correct answer

Enthusiast , Dec 19, 2018 Dec 19, 2018

Votes

Translate

Translate
Contributor ,
Dec 14, 2018 Dec 14, 2018

Copy link to clipboard

Copied

@rob day Tried the script and it works but it's indeed only useful for when you export the entire document. That is an option, of course, but it gets complicated when I only have to (re-)export 10 or 20 pages. Another pity is that InDesign is locked during the entire export process. But you said it was fairly straight forward solution so thanks anyway! O, and the numbers are 2 digits instead of 3.

@Stephen_A_Marsh That works like a charm!

First things first: I was wrong when I said that page 1 would be named Visie 01-2019_1.pdf: it's actually named Visie 01-2019_01.pdf. So all numbers below hundred are 2 digits by default already and pages from 100 and up are (obviously) 3 digits.

Because numbers are 2 digits by default already I (obviously) altered the Replace line to 0$2_$1 One thing is odd though: in your example all numbers end up in 3 digits (_1 > 001, _42 > 042, _112 > 112) but in my case one zero is added to any number. So _01 becomes 001, great, but _112 becomes 0112. (And btw if the file ends with _1 it becomes 01.)

But that's no big deal though, of course: I simply rename all files from 1-99 first with my saved preset and then I remove the 0 and rename all pages from 100 and up with just $2_$1 (for which I will make a seperate preset, of course ).

Obviously the most ideal option would be to get all this done in one go right out of InDesign but this is a very easy and quick to use work around so thanks a lot!!! If you figure out how come all numbers end up as 3 digits on your computer and not on mine let me know!

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
Community Expert ,
Dec 14, 2018 Dec 14, 2018

Copy link to clipboard

Copied

O, and the numbers are 2 digits instead of 3.

Open in Scrip Editor and replace

            set pgno to document offset of x as string

            set mynumbercnt to count of items in pgno

            if mynumbercnt is less than 2 then

                set myPageName to "0" & pgno & "-"

            else

                set myPageName to pgno & "-"

            end if

With:

            set pgno to document offset of x as string

            set mynumbercnt to count of items in pgno

            if mynumbercnt is 1 then

                set myPageName to "00" & pgno & "-"

            else if mynumbercnt is 2 then

                set myPageName to "0" & pgno & "-"

            else

                set myPageName to pgno & "-"

            end if

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
Community Expert ,
Dec 14, 2018 Dec 14, 2018

Copy link to clipboard

Copied

Hi J van E,

You will need to change the regex search and the replace to account for the single zero padding in both the original and intermediate filenames:

Original Filename

Find: (^.+)(?:_)(\d{1,3})

Replace: 0$2_$1

Intermediate Filename

Find: (^0)(0\d{2}_.+)|(^0)(\d{3}_.+)

Replace: $2$4

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
Community Expert ,
Dec 16, 2018 Dec 16, 2018

Copy link to clipboard

Copied

Bridge can use RegEx????  That is fantastic! Great tip Stephen!

AM

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
Community Expert ,
Dec 13, 2018 Dec 13, 2018

Copy link to clipboard

Copied

@rob day Understood but I still don’t know how to script the prefixes.  I didn’t only need the zero’s.

Ok, I missed the part about the old script breaking.

Try this AppleScript. It's fairly straight forward, asks for a PDF preset and exports all of the document pages with the absolute page number including leading zeros as the prefix

http://www.zenodesign.com/forum/ExportAllPagesPDF.zip

Screen Shot 15.png

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
Community Expert ,
Dec 13, 2018 Dec 13, 2018

Copy link to clipboard

Copied

If InDesign can export as separate pages with page number at the end... Then Bridge can batch rename, pad out the variable leading zeros and move from suffix to prefix. I’ll put together the string substitution regular expression later when I have time.

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
Community Expert ,
Dec 15, 2018 Dec 15, 2018

Copy link to clipboard

Copied

Bit late to the party - but why not do this?

Suffix _0^#

Capture.PNG

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
Contributor ,
Dec 15, 2018 Dec 15, 2018

Copy link to clipboard

Copied

@Stephen_A_Marsh Thanks, I'll give it a try!

@Eugene Tyson I have no clue what those symbols exactly mean and do LOL but that seems to be the best way to add the page number in 3 digits to all files! I will give it a try coming monday when I am back at work! If it works then I only need to use the Bridge rename option to put the number in front!

Is there a site which explains the function of all those symbols like _0^# and things like (^0)(0\d{2}_.+)|(^0)(\d{3}_.+)...? It's nice they are working but I'd like to know what's happening.   If Eugene's tip works and all my files have page numbers in 3 digits the Bridge search and replace codes maybe need to be changed too once more.

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
Community Expert ,
Dec 15, 2018 Dec 15, 2018

Copy link to clipboard

Copied

There's a small triangle beside the option, not very noticeable.

This automatically adds these symbols. I just put a 0 behind it.

Once you get to 100 it starts naming files _0100, _0101, _0102 etc.

Not sure if this is an issue.

But with batch rename you can remove the _0 in front of those selected files (be sure to just select files in their 100's)

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
Community Expert ,
Dec 16, 2018 Dec 16, 2018

Copy link to clipboard

Copied

Another excellent tip Eugene!!!

AM

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
Community Expert ,
Dec 15, 2018 Dec 15, 2018

Copy link to clipboard

Copied

Is there a site which explains the function of all those symbols like _0^# and things like (^0)(0\d{2}_.+)|(^0)(\d{3}_.+)...? It's nice they are working but I'd like to know what's happening.   If Eugene's tip works and all my files have page numbers in 3 digits the Bridge search and replace codes maybe need to be changed too once more.

J van E, for Bridge’s Batch Rename tool, what you are looking for is “regular expressions” or regex, regexp etc., also known as GREP in InDesign (General Regular Expression Print). InDesign offers GREP search/replace for text and there are GREP styles for live text formatting based on a search pattern.

RegEx is almost as old as computing, there are different flavours and there are countless web pages and videos to be found on the web. Without research I am not sure what the InDesign PDF export is using, they look like some special InDesign variable and not regex.

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
Community Expert ,
Dec 16, 2018 Dec 16, 2018

Copy link to clipboard

Copied

https://forums.adobe.com/people/J+van+E  wrote

Is there a site which explains the function of all those symbols like _0^# and things like (^0)(0\d{2}_.+)|(^0)(\d{3}_.+)...? It's nice they are working but I'd like to know what's happening.  

Mike Witherell's downloadable guide is a good place to start: http://jetsetcom.net/images/downloads/InDesign-CC-2019-GREP-metacharacters-2018-10-22.pdf

If the answer wasn't in my post, perhaps it might be on my blog at colecandoo!

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
Contributor ,
Dec 16, 2018 Dec 16, 2018

Copy link to clipboard

Copied

Thanks for the information, Stephen, and thanks for that GREAT pdf, Colin!!!

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
People's Champ ,
Dec 17, 2018 Dec 17, 2018

Copy link to clipboard

Copied

If I've understood correctly, https://www.id-extras.com/products/extract-pages/  should be able to do this.

Are the pages in your InDesign file already using the 3-digit numbering option (in the Numbering and Sections dialog, there's that 001, 002, 003... option).

If so, just use the <fp> code in the custom naming field, and it should work.

Ariel

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
Enthusiast ,
Dec 19, 2018 Dec 19, 2018

Copy link to clipboard

Copied

This script does what you're asking for.

https://www.marspremedia.com/software/indesign/pdf-export-single-pages

William Campbell

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
Contributor ,
Dec 20, 2018 Dec 20, 2018

Copy link to clipboard

Copied

We have a winner! Thanks for that link, williamc3112933! That's EXACTLY what I was looking for!!! Well, as long as the document doesn't have sections otherwise I need to rename files once more but that's no problem. But for my regular documents this works as a charm! It exports my doc and gives me seperate pdf's which filenames that start with the actual pagenumber in 3 digits, even when I export a few specific pages. TOTALLY AWESOME!!! Thanks again (and also everyone else who participated)!

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
Enthusiast ,
Dec 21, 2018 Dec 21, 2018

Copy link to clipboard

Copied

I'm glad it works for you. If you have a document with sections it also works. It's just that if duplicate page numbers exist in multiple sections, a section label is required or pages might overwrite one another. For example, a front matter section page "i" then a main section label "1" need more than just the page label, because the script (as I designed it) uses Arabic numbers always, so that pages sort correctly in a prepress run list. In that case both are labeled" 001" and one would overwrite the other. So a section label is required. But if a document has sections with completely unique page labels (numbers), then it is possible to uncheck the "include section label" option, to produce the result you want (no section label, only page label). This also works for docs that use section numbering, but are really just a single section. Typical when a document is set up to begin at a higher page number rather than start at page 1. That's my main use for it, and the original reason I wrote the script. I do magazine work that arrives in sections but doesn't use a book document. The designers who work on each section manually assign the starting page number for the section they work on. I output the PDFs using the script but disable section label so I end up with the entire magazine numbered from 001_doc name.pdf to ... 128_doc name.pdf (for example). Of course the script will also do document numbering (absolute) though I rarely use it. I like having the PDF labeled with the number as it appears in the layout. Less confusion that way. If anything about the script isn't working how you need, let me know, I can always tweak it.

William Campbell

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
Enthusiast ,
Dec 21, 2018 Dec 21, 2018

Copy link to clipboard

Copied

LATEST

Not familliar with PDF Bee, but I use PDFSAM Split and merge PDF files. Free and open source - PDFsam for my PDF splitting needs and it works great. I was having a problem with using acrobat to split up the files, each new PDF was increasing in filesize!

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