Home | Tips | Library | Other Authors | Other WP Sites | Writer's Links | Contact | Site Map | Donate

Barry MacDonnell's
Toolbox for WordPerfect

Macros, tips, and templates for Corel® WordPerfect® for Windows®
© Copyright 1996-2024 by Barry MacDonnell. All Rights Reserved.

Page updated Aug 18, 2023

WordPerfect Tips
Main tips page | Browse more tips

Mixing landscape and portrait pages:

How to maintain headers, footers, and page numbering at the top and bottom of all printed pages when you mix landscape orientation with portrait
[see screenshot]


Related pages -

Headers, Footers, and Watermarks - how to start, stop, suppress, edit, change, replace, delay, overlay, and remove them

If you decide to change a particular page or pages in a portrait-oriented document to landscape orientation, you can do this in at least three ways.

Method 1
Be sure to set the View menu choice to Page, not Draft. Then -
Step 1.  Place your insertion cursor on the page in question;
Step 2.  select Format, Page, Page Setup [WordPerfect 8 and later versions];
Step 3.  click the Landscape radio button, then OK
Step 4.  move to the page where you want to return to portrait orientation;
Step 5.  repeat steps 1-3 but click the Portrait button.
However, there are two possible problems with headers and/or footers using this othewise common-sense method:
•  Rotated headers and footers when printed

If you use headers or footers in the document you will notice that — when you print and assemble the document — the headers on the interpolated Landscape pages are now located along the left (long, vertical) edge of the page, not the top (short, horizontal) edge.
Footers will be similarly misplaced along the long right edge.

In effect, the headers and footers on the printed document were rotated 90 degrees counter(anti)-clockwise, the same as the page's main content. They are not where a reader would expect to see them.

Therefore, you might want to consider using Method 2 or Method 3 to create intermediate (interpolated) landscape-oriented pages.

•  Misaligned header/footer margins with the right page margin

If you have text inside the header or footer that should extend to the page's right margin (e.g., lengthy text or flush right text), the right margin inside the
header/footer on the landscape page will not extend to match (i.e., line up with) the right margin on the landscape page itself (and cannot be dragged to extend it there) if the prior page was a portrait page.

In effect, right margins on mixed portrait and landscape pages are misaligned because the header/footer is shorter on the interpolated  landscape pages — a situation that can be very visually apparent if they contain a lot of material, or they have flush-right material. Moreover, it will be longer on the immediately following portrait page (if any).

Note:

This issue should not appear if all pages, or just the first pages, are in Landscape orientation. (But in the latter case, a subsequent Portrait page will probably have elongated headers/footers!)

Since this issue is seen in WordPerfect over many program versions, one might wonder why it was never fixed. One guess is that it served the purpose of maintaining pagination in the document if one or more pages are switched to landscape orientation and their headers or footers contain enough text to change the vertical space they occupy on the page when the orientation changes, causing some main document text to flow on other pages. This, in turn, might affect features that depend on accurate page numbering such as a Table of Contents, Index, etc. [Regenerating the document (with Tools, Reference, Generate) should correct this; see (e.g.) here for more.] Hence, it might a been the developer's unhappy choice between accepting a possible small problem a few misaligned headers or footers and a larger, more complicated one. But all this is just a guess.

For a macro solution to this misaligned margins problem see Footnote 1 below.


Method 2

[As with so many things in life, this method is easier to do than to explain. But you should be able to complete the steps in a few minutes — and even more quickly in subsequent sessions.]

Overview

To maintain headers (and/or footers) in the same position on all document pages (i.e., in portrait orientation), you could convert the material on pages that should be in landscape orientation into single-page graphic boxes whose contents are rotated 90 degrees.

This is different to Method 1 above, which changes the entire page setup of affected pages to landscape orientation. Here, however, the affected pages remain in portrait orientation; it is just the body text area that is rotated to landscape, using a "container" box to do the rotating.

When you rotate the body text area this way the headers/footers — being separate structures — will remain in the same portrait orientation as other pages in the document, as in this example:

Computer screen Screen shot of sample pages

Another way to describe this:

All physical pages (and their on-screen representations) remain in the same (portrait) orientation, but the main body area of the landscape pages is rotated 90 degrees counter(anti)-clockwise. Any header or footer remains in the same size and orientation as on portrait pages. (See screen shot.)

In Method 1 above, however, the physical landscape pages and all material on them is rotated 90 degrees clockwise compared to portrait pages.

Suggestions:

The methods here largely depend on the desired end result. If the document is to be printed, and possibly bound, then Method 2 is a good choice since all physical pages will be in the same portrait-printed orientation. If the document is to be created as a PDF document, then Method 1 can work in many cases (but see the misaligned margins issue described above).

Using Method 2 probably is best done on the final draft of the document, since it can affect the flow of content, page numbering, etc., and sometimes require a bit of format adjustment on the landscape pages.

Caveat:

If you have multi-page tables in landscape format, Method 2 will not work since it creates a single-page graphics box, or "container," to hold the rotated material. If you have such landscape oriented multi-page tables, see Method 3 below.

Here's how to do this [in WordPerfect 8 (c.1997) and later].

Tips

¤  It might be easier and possibly less confusing to first copy preexisting  material that will be used in the landscape page's rotated graphic box into a new, blank "source" document, where it can be selected later (as a block or piecemeal) and copied back into the new box. This should let you remove the preexisting material from the main working document to make room for the new box.

¤  If you open Reveal Codes you will be able to see where the [Box] code is placed in your main document when you finish this process. (See also the Tip in Step 11 about using just that code as a QuickWord for future use.)

¤  Always make a backup of the document before using this method.

Create the graphic box for the "landscape" page:

(Step 1) If you already have page content to use in landscape orientation, select that page with Edit, Select Page (or select the material with your mouse or keyboard). Then copy it to the Windows clipboard with Edit, Copy (or <Ctrl+C>). (You can remove that source page later.) If you don't have — or you have not decided on — content to use, you can add it later.

(Step 2) Go to the bottom of the page that precedes the where the first landscape page will appear (i.e., the very bottom of that page at the end of the last line of text). Click there to insert the cursor. [If you are on page 1 and want that page to be landscape, just go to the very top above all format codes with <Ctrl+Home> — or if using the DOS keyboard definition, press <Home> three times, then <UpArrow>.

(Step 3) Insert a new blank page with Insert, New Page (or <Ctrl+Enter>), and place your cursor in that blank page. Tip: Use View, Zoom to set the zoom to Full Page. This will let you see the entire box as it is created.

(Step 4) In the new blank page, click on Insert, Graphics/Pictures, Custom Box, User [style], OK.  An empty text box with 8 "drag handles" (small black squares) around the box's perimeter will appear on the page.

(Step 5) Right-click inside the new box and select Size from the context menu that appears. (Alternatively you can just click the Graphics button on the property bar to display this menu, and then select Size.) The Box Size dialog appears.

(Step 6) Change both the box's width and height to Full, then click OK. The box will automatically change to "Page" when you click to accept the next "If you change the box size to Full ... OK?" message that pops up. Once you click OK and the message has been dismissed, there should be an empty, page-size box on the page, with 8 small (black square) drag handles around the perimeter (whose border lies on the current page margins).

Edit the new box to insert your text, table, image, etc.:

(Step 7) Right click on the empty box and choose Content. The Box Content dialog appears. The "Content type" defaults to "Empty" (which is fine).

(Step 8) Click the Horizontal and/or Vertical position buttons and choose the position of the box's material. Typically this is "Left" (Horizontal) and "Top" (Vertical), or you can accept the default for both as "Centered". (You can edit the box later to change these settings.)

(Step 9) Click the Edit button on the Box Content dialog. The box's drag-handle border will turn to a hatched (/////) border.

(Step 10) Insert the content in the box:

•  If you have not yet copied your desired content to the Windows clipboard to use in the box, type some "placeholder" text in the box such as "SAMPLE". (You'll need something in the borderless box to be able to see it from the main document editing screen.)

•  Otherwise, insert the desired page contents you copied earlier to the Windows clipboard (i.e., text, a table, etc.) with Edit, Paste (or <Ctrl+V>).

Either way, the content will not be rotated yet.

Note: If there is too much content to insert into the box you will get a warning message. Dismiss it. You might need to adjust the following page's text later to provide continuity for the material.

(Step 11) Rotate the content in the box:

•  Click anywhere outside the box area (e.g., outside page margins) to exit from the box's contents editor and deselect the box (no border visible).

•  Right-click on the box area again and choose Content to bring up the Box Content dialog.

•  In the Box Content dialog click on the option to "Rotate text counterclockwise 90 degrees," then click OK. The text or other inserted material should now be rotated in the box, positioned up against the bottom page margin (or the page footer, if used).

•  Click anywhere outside the box area again to deselect the box.

Tip: You can select just the [Box] code in Reveal Codes and save it as a QuickWord for future use, thereby saving the trouble of completing Steps 4 to this point in the process. This might be especially helpful if the only content in the box at this point is just a text placeholder.

•  Replace any placeholder text (Step 10) with the desired material. See Notes below.

Notes

¤  You can always edit the contents of the box using the Box Content dialog's Edit button (using the right-click methods above or by double-clicking the [Box] code in Reveal Codes), or by simply left-clicking directly inside the box area. In the large edit window (titled "Text Box Editor" at the top edge of the WordPerfect program window) you can make changes there and then use the Close Editor button on the property bar to return to the main document.

¤  You may have to make minor adjustments to the page content, margins, or the border space inside/outside the graphic boxes (right-click on the box, then select Border/Fill, Advanced) or the font size of the box's text, depending in the size of your original page content. Otherwise, some of the box's contents might not display properly.

¤  You can also re-adjust the overall Horizontal and/or Vertical position of the contents (Step 8 above) later, but if a position button is dimmed-out  you can temporarily toggle the Rotate radio buttons between "90 degrees" and "No rotation" to access it. Then return the selection to "90 degrees" before exiting the dialog.

(Step 12) When finished, click outside the page box. You might need to adjust the following page's text to provide continuity.

Repeat these steps for all pages that need to be in landscape orientation.

Page numbering (OPTIONAL):

If you use page numbering, you most likely will want to keep the same header/footer orientation as exists on the document's portrait pages (i.e., along the top/bottom or "short side" of the page); hence, you might prefer to put the numbers inside the headers or footers on all page, and not on the pages themselves. If so -

•  Go to the top of your document and turn off any current page numbering (so that you don't get page numbers appearing twice on each page) with Format, Page, Numbering, Position: <No Page Numbering>.

Note: If you still see page numbering it is most likely due to an extra [Pg Num Pos] code on the page — possibly located inside a [Delay] code. You should be able to delete that code in the Reveal Codes window.

•  At the top of the document, either create the header (or footer) that will hold the page numbers, or edit an existing header (or footer) by clicking inside it. At the appropriate location in the header (or footer), insert the page number with Format, Page, Insert Page Number, <choose number type>. Or, when your cursor is inside the header (or footer), a property bar appears with a button on it you can use to insert a page number into the header or footer.

Method 3 (multi-page tables in landscape orientation)

Method 2 above shows how to convert a single page of material to a rotated graphic on a landscape page. This allows page numbering (whether in a header, footer, or otherwise) to remain in the same relative location as found on portrait pages. It also allows header/footer material to be changed globally without worrying about what is in a header/footer on the landscape pages.

However, a multi-page table cannot display outside a one-page graphic image box, so Method 2 is limited to single-page tables.

•  Instead of converting your multi-page landscape table to a graphic image, allow the table to span as many pages as required in the normal document, in landscape orientation, then at the top of the next page following the multi-page table, restore the pages to portrait orientation with Format, Page, Page Setup.

•  Discontinue any normal header or footer at the beginning of the multi-page table with Insert, Header/Footer, (select the type), Discontinue; and then create them again following the table pages with Insert, Header/Footer, Create.

Alternative: Suppress the header/footer on each page of the multi-page table with Format, Page, Suppress.

•  Go back to each of the landscape pages containing the table and create a text box on them (click Insert, Text box) with a page number inside the box (and other material if desired, such as might be in a header or footer): Just click Format, Page, Insert page number while inside the box.

Note: If you use normal page numbering (Format, Page, Numbering), you'll now have two page numbers on the page! As noted, if the all page numbers are inside a header or footer you can remove (discontinue) the header or footer for the multi-table pages and use text boxes to imitate them. This is a good reason to place page numbering inside headers or footers (see footnote here) and not use the more typical Format, Page, Numbering method; page numbers produced with the latter can only be suppressed or removed on a page, which will also suppress or remove numbering in text boxes, headers, or footers.

•  Click outside each box, then right-click it to display the eight drag handles and the context drop-down menu; on the context menu choose Content, then "Rotate ... 270 degrees."

•  From the same context menu, choose Position, and select "Page" and also check the box, "Keep box on page."

•  You might also want to remove the box's border with Border/Fill, <None>.

•  Finally:  Whenever each box is selected it can be dragged to what will be the top of the page when the document is printed and collated — the same relative location where page identification material is found on the document's portrait pages.


Footnote 1
[Continued from above...]

Headers and footers that have misaligned margins compared to their page margins in documents with mixed Landscape and Portrait pages can be most easily fixed with a macro.

(See above for a description of this issue. Note that documents with all landscape pages or all portrait pages do not typically have this problem.)

The macro below scans just the current page
where the cursor is located — typically, a landscape-oriented page and if any header or footer is found there it copies the contents of that header or footer to the clipboard. (There can be up to four of them on a page: HeaderA, HeaderB, FootnoteA, and FootnoteB.)

Then it re-creates a new version of that particular substructure with the same contents — thereby "refreshing" the header or footer.

Finally, it moves to the top of the next page and quits with a brief message.

The result is most noticeable when the header or footer contains a lot of text, or some right-aligned or flush-right text: The material should now extend to the right page margin instead of appearing truncated on the page.

Notes

•  It's important to note that the macro processes just the current page where it is played in the document, and NOT the entire document. This gives you the chance to see if there are any unwanted effects.

•  You can (and probably should) play it again on the next page if it also shows a problem with its header/footer
— such as can happen when

▸ a portrait-oriented page follows a landscape page and also needs its header(s)/footer(s) refreshed to fit between the portrait page's margins, or
▸ the header or footer placement on pages was subsequently set to either Odd or Even pages, or
▸ new headers or footers were started on the current page.
A final message advises on these issues.

Tips

•  Always make a backup of the document before playing the macro. [See Disclaimer.]

•  Ctrl+Z should Undo the changes the macro makes to the document.

•  Be sure to read and follow any advisory message that appear when you play the macro. One important such message describes the simple steps you should take before playing the macro: add a pair of page breaks to "isolate" or "contain" the Landscape page's contents to that single page to prevent possible "text flow" onto that page (which might confuse the macro). When the message appears you are given the option to Cancel the macro and return to the document to do this.

•  If you create a toolbar button to play it, it takes just mouse click to fix your headers/footers on the current page with this macro.


Download the macro contained in this Zip file:
RefreshHF.zip (~ 13.4Kb)

Extract the
RefreshHF.wcm macro from inside the Zip file and place it on your Windows desktop or any convenient folder. You can then copy or move the extracted macro file where WordPerfect can find it, as described here.

For operational details, etc., you can open the macro like any other WordPerfect file and read the comments at the top of the macro code. The operative macro code itself is heavily annotated to help other macro writers.

For convenience here is the same information:

* * *

Purpose


The RefreshHF.wcm macro's main purpose is to correct right header/footer margins on landscape pages that were inserted or created inside a portrait-oriented document ("mixed landscape and portrait pages") so they align with the document's right page margins.

This can happen primarily on such landscape pages and probably on any following portrait page -- and it's especially noticeable with headers or footers that contain flush-right or right-aligned text, or have large amounts of content that should wrap at the right page margin but do not.

It works by simply re-creating ("refreshing") all headers or footers on the current page where the problem appears in mixed landscape and portrait page documents, when a page is switched from portrait to landscape or vice versa. [Note that documents with all landscape pages or all portrait pages do not typically show such a problem.]

Macro operation

[These are the steps the macro takes when you play it.]

1. Display some initial advisory messages -- especially one about being sure to manually isolate landscape pages with hard page breaks (Ctrl+Enter) before playing the macro so their document text, and any header/footer codes in that text, does not "flow" onto another page. (A message pops up when you play the macro to recommend this.) The page breaks should be placed like this:

End of preceding page text.[HPg]
End of current LANDSCAPE PAGE text.[HPg]
Next page...

2. Verify there are existing headers or footers that display on the page.

3. Search (forward) for header codes and (backward) for footer codes on the current page. If not found, go to the top of the page; otherwise place the cursor just after the item found.

4. Determine the item's page placement (i.e., whether it should display on Odd, Even, or All pages).

5. Edit the item and copy the entire contents, including any format codes inside it, and

a. delete the current [Header] or [Footer] code (if any);

b. at that same location create a new header (or footer) code of the same type (A or B) and with the same page placement (Even, Odd, or All); and

c. paste the original contents into that new structure, to essentially "refresh" that structure's display.

6. Repeat steps 3 - 5 for any other headers (A or B) and footers (A or B) on the current page.

7. Display final advisory messages, and then exit (Quit) the macro.

Important useage notes

• Always make a BACKUP of the document before playing the macro.

• You might have to play the macro again on adjacent pages, especially where the page setup changes (i.e., portrait to landscape orientation or vice versa), or the header or footer placement on pages was subsequently set to either Odd or Even pages, or new headers or footers were started on the current page. (A final message advises on these issues.)

• Because this macro cannot anticipate all possible document formatting, you will need to carefully attend to any changes it makes. (Use Ctrl+Z to Undo the changes.) This is the main reason the macro processes just the CURRENT page each time it is played. This gives you time to inspect the changes. In any case, you probably would need it for just a few pages in a document with landscape pages mixed in with mostly portrait pages.

• Even so, there can be a related issue to deal with: After refreshing headers and footers or making other changes to these items, you might need to review any pagination issues in the document -- including features that depend on page numbers such as Reference tools (Table of Contents, Index, WordPerfect Lists, etc). Usually, just re-Generating the document (via the Tools > Reference menu) should re-paginate if required.

As you might conclude, the macro is a workaround rather than a fix for the problem. As such it requires you to be attentive to the things that can affect headers and footers and the "stream" nature of WordPerfect formatting. But it should solve the immediate issues some users face when mixing landscape and portrait pages.

* * *

The
RefreshHF.wcm macro was developed in response to a thread discussing the misaligned header/footer margins problem on WordPerfect Universe here.