Is there a way of copying master Pages in a template?
You've guessed my problem in one (it makes me wonder if this is a common question - which means RPE really ought to be able to accommodate it)
I want to switch between Portrait and Landscape, depending on the status of an Object Attribute. Two of us have spent several days trying to work out a means of doing so, and the only way we can think of is to effectively duplicate the contents of the Container in the Template Content that creates the text, identical except for selection of Master Page being dependant on the Attribute. This would be a real pain to do, especially as we have several templates.
Can you explain how we can add code to the Orientation property of the MP. Page Orientation appears to be a switch True/False in the "Format Specific" property of the MP, but there is no option to code it. Actually, I'm not sure that'd be adequate - because the Header/Footer will not expand to fill the width of the page. This must be a common problem, lots of users must need to include landscape pages in documents.
- PVMW 27000624KV
This may not be the solution that Dragos was talking about but here is how I have achieved this in the past.
Unfortunately i had to have 2 master pages - Portrait and Landscape
You are correct you cant directly script the orientation but you can script the master page field.
So in my case I had a variable called Landscape which was boolean and I wrote a simple java script to check this value and set the master page based on this
Hope that helps
- ChrisHardy68 270001C1X6
I sort of understand where you ar coming from. I also have two master pages, Portrait and landscape, and an Attribute that identifies which style to use.
The problem I see is that my Template Content has two containers, one that uses portrait and one landscape. Each of these has a Condition, which tests the attribute and then executes the content of the selected container. This gives me two problems;
1. If there are a number of landscape objects in sequence, after each landscape page is created a blank portait page follows because RPE sequences though each container and even if it doesn't output an object it still changes the orientation.
2. Second problem is more awkward, and means the page numbering gets reset every time the orientation changes. This is because I have an "Index" template that produces the first few pages in Roman numerals. I then change to the Portrait template, and tell it to restart numbering. If iI then switch to landscape and back again the numbering resets.
I don't think your solution will solve the second problem. As for the first, it might - but where do you put the Java that tests the attribute value?
- PVMW 27000624KV
the solution provided by Chris is correct and prior to 1.2.1 was the only solution to this problem. With RPE 1.2.1 we now support/allow using variables/scripts to define the Master Page's properties which in turn permits for a simpler solution for this problem, a solution that does not require duplication of master pages.
@Paul - you are correct in saying this is a rather common request so I have put together an example with additional explanations on how to use this new 1.2.1 feature: http://rpeactual.com/2014/02/21/new-in-1-2-1-dynamic-master-pages/
- Dragos.Cojocari 270001QUCG
One further point to this. I followed your instructions and they worked fine for the pages numbers but now the total pages numbers is causing an issue as they are reset every time the orientation\section\masterpage changes
The issue is that if you use Total no of Pages (NumPages) this counts all the pages in the doc whilst Section pages (SectionPages) counts the number of pages in that section. Each time the orientation or masterpage changes its classed as a new section.
On the face of it it would seem that the correct item to use would be Total no of Pages (NumPages) however, what happens if you have a section(s) before the main body of text that you dont want to to count in the total pages e.g. Title page, contents etc.
Example. You have a 12 page doc,
Page 1 is a title page
page 2 is a contents page
Page 3 - 12 is the main contents
On the last page of the doc you would have a footer that reads: "Page 10 of 12" when really I would like it to read "Page 10 of 10"
Does that makes sense.
I actually think this is a Word limitation rather than RPE. The only work around i can think of is to put a "dummy" book mark on the last page and use it as a reference in the footer!
Paul: Have attached an example of where i have got to so far
I have the exact same problem, which can apparently be solved as Dragos says:
"I assume you have some variable to determine when the orientatation change should occur. You can also use it in the "restart numbering" property to tell RPE not to restart numbering if just the orientation changes."
Unfortunately I do not know how to do this so we are stuck in the same position!
- ledel1990 270006TBR5
@Chris - I think you are right here and there is no straightforward way in Word to do this. Section pages would work if there would be a way to change the page orientation without introducing a section break. I see others faced this issue and their solutions are quite complex. If we can find a way to do this in Word I'm pretty sure we can get it to work from RPE as well.
- Dragos.Cojocari 270001QUCG
good news. There is a rather clean way to do what you need using the formula field. The process is:
If you do this manually make sure you use CTRL+F9 to create the fields ( both the formula one as well as the NUMPAGES and PAGEREF one) otherwise Word will complain about syntax errors.
The problem is that you cannot create this type of composite field in RPE right now so you'll need to use one of these solutions:
Thank you very much for your assistance - I have managed to use your suggestion in my template.
I will mark my other post as answered and refer to this one.