This tutorial is designed to provide you with a basic orientation to Open Office Styles. The concept can be a little difficult to grasp at first but the goal of this tutorial is to give you a basic practical understanding of styles so that you can leverage this powerful capability within your forms.
Start Open Office and create a new blank document
Notice in the circled area above the word ‘Default’. This is your current page style for the first page. The first thing we will do is to create a new style based on ‘Default’ page style for the first copy within our document.
The styles docking toolbar will appear either in a separate window or (as is shown above) within a docked panel within the Open office editor.
Click on the circle button to display page styles and the display above will be shown
In the styles panel, click on the icon circled above (right) and the “Create Style” window will be displayed. We are going to create our page style for our “Office Copy” page. So, we entered the name “1 – Office Copy” into the name of this new style. Follow these steps and press OK.
Right click on the page style “Default” as shown below and a series of pop-up options will be shown that allows you to change the page style. Choose “1 – Office Copy” and that page style will be applied the current (and only) page as shown below (see circled area).
With the page style “1 Office Copy” setup and applied to this first page, we’ll now modify this page which will in turn modify the page style. Any page within the document that references the page style “1 Office Copy” will reflect the changes we make. This means that we do not need to manually change each page. Just change any page that uses this style and all other pages that use the same page style will be updated.
Modify the margins of the “1 – Office Copy” page style
Menu: Format > Page
Modify the page margins to .5 for left, right, top and bottom. This is standard for forms and allows us to place more information on each page.
Add a header to the page style
Menu: Format > Page > Header
Check the box “Header On” to enable the header for this page style and then press OK
Perform the same action for the Footer as shown above.
Now there should be rectangles in the document. The top small rectangle is the header area. The big rectangle in the middle of the document is the body area where our data will live and the small rectangle at the bottom is our footer that will repeat on each page of the document where this page style is applied.
For example, I’ve entered some text into the header just to illustrate.
The text above include an Open Office field to allow Open Office to inject the current page number into the header. To inject that field, I simply chose from the menu: Insert > Fields > Page Number. This feature allows Open Office to automatically inject the current page number. If we perform page numbering this way, then no matter how large your final document (pages), Open Office will manage your page numbering and you’ll not need any server-side code for this purpose.
Verify Page Options
There are a few quirks in OpenOffice having to do with how breaks (page breaks and section breaks) will automatically inject blank pages into the document. To prevent this misbehavior, I recommend setting the following options in Open Office and saving the document.
Menu: Tools > Options
- In the left panel, scroll down to ‘OpenOffice Writer” and click on it
- Then, under that section, click on “Print”
- Verify that “Print Automatically inserted blank pages” is unset
- For good measure, also unset “Left pages” and “Right Pages”
- Press OK
Place Data in Body of Document
Now, back in the document, place the cursor in the large rectangle representing the document text body.
Press return a few times to insert some paragraph marks just to give some play area in the document
Insert a Table
Menu: Table > Insert
Fill out the fields as shown above then press OK
A table will appear in the body of the document (see yellow circled area below)
Now, click the cursor in an area below the table and insert another table.
We will end up spitting the document so that the second table is on its own page. The top table will be the “Office Copy” and the bottom would be the “Customer Copy”.
First, we need to add another page style for our “Customer Copy."
Menu > Format > Styles and Shading
- In the Styles panel, click on the yellow highlighted button to select ‘page styles’
- Ensure that ‘1 – Office copy’ is selected
- Click the button circled in red to create a new style based on the selected style
- Enter the name “2 – Customer Copy” as shown
- Press OK
Create the break between the first table and second table
- Place your cursor in the white space after the end of the first table and before the start of the second table.
- From the menu, choose insert > more breaks > manual break
- This will pop-up a small editing window with these fields:
- Type = Page Break
- Style = <the page style for the second copy that you defined (e.g., 2 - Customer Copy)
- Change Page Number = Checked
- Set the page number to 1
- This will pop-up a small editing window with these fields:
This will inject a manual page break between the first and second tables. When the break to the second copy occurs, the style selected in the manual page break will be selected and this will change the header and footer for these pages.
Change the Customer Copy header to make it unique
- Click anywhere in the header of the second page and change it to read “This is the header for the customer copy”but leave the page number in place.
- Scroll back to the header on the first page and note that the header of the first page did not change. This is because the first page uses the style of “1 – Office Copy” and the header for that page style is kept separately from the header for the “2 – Customer Copy” page.
Test Automatic Pagination
Place the cursor into the document body after the table on the first page and press <return> until you overflow into a second page
- Note that the lines added to page 1 causes a normal overflow into page 2. But if we scroll to page 2 and observe the header of that page, we’ll see that the header is from the “1 – Office Copy” style and the auto page number changed to “2” from 1. This shows that auto page numbering works (at least for the Office Copy).
- Scroll down to the start of the second table and place the cursor into the body of the document after the second table. Observe the following
- At the bottom, we see that the page style “2 – Customer copy” is active for this page
- The page number display on the bottom task bar shows “Page 1 3/3”. This means that we are on page number 1 (because we reset the page number on the break” but in truth, within the document, we are actually on page 3 of 3 (3/3).
- Note that the header shows the proper header for the customer copy (see yellow highlight)
- Note that our auto-inserted page number is back to 1 because we reset the page number to 1 as part of the break directive we entered as part of the first row of the second table
There are several ways to create watermarks with Open Office. The easiest method is to simply place text into the header or footer of the document. A more involved technique involves the use of frames. A frame is an object that can be inserted into a page. You can place the frame into a header or footer of a page and then the frame will be repeated on all pages where that style applies. This means that if content applied to a page spans to multiple pages that this frame watermark will appear on each of the pages.
To create a frame-based watermark, follow this procedure:
- Place the cursor into any area of a footer on a page where you wish to have the watermark applied
- Menu Insert > Frame. The following page will display:
- Press okay and a rectangle will be inserted into the document with green anchor points marking its four corners.
- Drag the rectangle into the position on the page where you wish for the watermark to appear
- Use the green anchor points to resize the rectangle to a size that is suitable for the desired watermark.
- Enter text into the frame
- Choose Format > Character to set the properties of the text within the frame:
- Choose the “Font Effects” tab and set the font to ‘Outline’ and the color to ‘Gray 1’
- Press OK and then left-click on the frame to select it.
- Choose “Borders” and remove the borders from the frame as shown below
- Print Preview the document and check the position, color and other presentation of the frame.
- If you wish, temporarily inject lines into the page to test whether it is paginating correctly and preserving the watermark on each page.
These techniques are the basic building blocks for creating powerful forms and fully utilizing the features of Open Office to create powerful features without programming