Copy link to clipboard
Copied
I want the second page of my document to be blank - no headers or footers. If I manually go to Format>Page Layout>Master Page Usage>Custom - There is an option called None which achieve this.
I have the following script:
function ApplyMasterPages(doc)
{
var bodyPage = doc.FirstBodyPageInDoc;
bodyPage.ApplyPageLayout(doc.GetNamedMasterPage('Cover Page'));
bodyPage = bodyPage.PageNext;
bodyPage.ApplyPageLayout(doc.GetNamedMasterPage('None'));
}
It doesn't give me an error, but it doesn't remove the headers and foolters either.
I realize I could create a new Master Page without headers or footers and name it "Empty" and apply that it would probably work, but that seems redundant when the built-in option "None" should work.
Thanks for the assistance!
Use this to apply None:
bodyPage.PageBackground = Constants.FV_BGD_NONE;
Copy link to clipboard
Copied
Possibly not useful, but one of my projects has an MP named "Blank", which is only usually blank.
The header & footer frames are there, but have content controlled by Color Views or Condition codes. All is invisible for print. All but nav hyperlink is invisible for PDF.
Copy link to clipboard
Copied
Bob - Thank you - that's bascially what I meant by creating a master page named "Empty". I've done that and it works as a workaround, but I'd rather not have an extra master page in the document since the built-in "None" master page should work if I could figure out how to apply it.
Copy link to clipboard
Copied
re: …I'd rather not have an extra master page in the document since the built-in "None" master page should work if I could figure out how to apply it.
That sentence might well be defining the problem. I've never used the None feature in the apply-MP dialogs, but what what it appears to be doing is removing any MP assignment, rather than assigning some empty internal MP named "None".
I also have no bets on what happens as pages are inserted or deleted prior to that in the doc, or if an AMP is run.
Copy link to clipboard
Copied
Interesting. It's following the cover page so there shouldn't be any pages being added or deleted prior to it. It's a left-hand page, so I would think if it removed any MP assignment, it would then use my Left MP. Come to think of it - If I apply MP "None" pre my script above, I think it does use the Left MP (with headers and footers). If I manually apply Master Page Usage and select Custom and None - it removes the headers and footers.
The "Empty" master page works and might be my best option.
AMP = ???
Also - Off-topic, but I'm not getting any E-mail notifications, but the bell icon seems to work and everything seems to be set up properly. ???
Copy link to clipboard
Copied
re: AMP = ???
Format ▼ Page Layout » Apply Master Pages…
re: Off-topic, but I'm not getting any E-mail notifications…
I did, and for that reply. Your account here, curiously, does not appear to have a screen name. The base note is by [blank] and your replies have an Adobe-generated AUTHOR in a gray box.
Copy link to clipboard
Copied
I'm getting E-mail notifications now - seems like it took a day for them to show up.
I'm going to contact a moderator on the screen name. I thought it just didn't appear for me b/c I was logged in on my account. I tried to fix it in account settings, but now it is "Marshall29930476kcck" it should be "Marshall Brooks".
Copy link to clipboard
Copied
Use this to apply None:
bodyPage.PageBackground = Constants.FV_BGD_NONE;
Copy link to clipboard
Copied
Rick - worked like a charm. Thank you!!!