Frequently asked questions - Writer

    From The Document Foundation Wiki
    < Faq‎ | Writer

    How to avoid printing some objects

    Chose the object types to print

    • In Tools ▸ Options ▸ LibreOffice Writer ▸ Printing ▸ Content you can chose the type of objects you want to print:


    screenshot of the writer printing options
    Menu Tools ▸ Options ▸ LibreOffice Writer ▸ Printing


    • The printing settings defined on this page apply to all subsequent printing tasks until you change them.
    • If you wish to modify the settings only for the current printing task, use the option in File ▸ Print ▸ LibreOffice Writer [tab].

    Choose the objects to print

    The options available globally or during printing allow you to choose whether to include pictures and drawing objects during printing, but not to choose some objects to be printed while rejecting others.

    The method you should use for this purpose depends on whether pictures or drawing objects are involved.

    • Pictures have a Print property: right click the picture and then choose Picture (or select the picture and then choose Format ▸ Picture ▸ Options [tab] and uncheck Print.
    • Drawing objects do not have this property. The workaround is to insert a section in the document and to anchor the drawing to this section:
      • it is possible to insert a section in a frame
      • sections can be hidden on demand via Format ▸ Section


    screenshot of the Format Section dialog
    Hide a section via Format ▸ Section

    Automating the switch between printing and not printing an object

    As the screenshot above shows, sections can be hidden conditionally. It is possible to automate the switching between Show and Hide by inserting a variable[1] into the document.

    Creating and inserting the variable are done via Insert ▸ Fields ▸ Others ▸ Variables [tab]. Choose Set variable, give it a name (for example Hide) and a TRUE or FALSE value, and check invisible, then insert it into the document. A small gray rectangle will appear on the page to mark the field.

    Next insert sections into the document to "surround" the parts whose printing is to be optional. Check the box for the section to be "conditionally hidden", and enter the variable name. The visibility of the section will then depend on the TRUE or FALSE value of this variable. You can modify the value by:

    • a double click on the field
    • placing the cursor immediately before the field then Edit ▸ Fields
    • via an input field in the document
      • In the example below, a variable named Hide has been inserted invisibly at the beginning of the document. To make reading easier, it is inserted in text format.
      • An input field for this variable is inserted into the paragraph "click here" ; it is enough to enter TRUE or FALSE
      • The first table is inserted into a conditionally hidden section; therefore the whole section is hidden
      • The second table includes a frame in A2. A hidden section is inserted into this frame, which will be hidden depending on the same condition ; therefore this is the frame only that is hidden.


    screen shot of the dialog for entering the field
    Switch between Show/Hide by entering a variable

    Note:

    1. Variables associate a name (the name given to the variable) with a value or an object. This value can change, hence the name, and the variable fields allow you to add dynamic content to the document.