
The command creates a new document.
When the command is invoked, a dialog box (see Figure 15-1) is displayed that offers three options for creating a new document:
Documents can created from scratch by entering the required information.
A new template can be created that will be used for creating a new document.
Documents can be created from an existing template.
The preferred method for creating a new document is to use a document template, either by selecting an exiting template or by creating a new template.
In this dialog, you can choose the method for creating a new document:
If you decide to create a new document from scratch, you will need to choose the type of document that you want to create from the drop-down list to the right of the radio button. The available options are:
DTDless XML for XML documents that do not use a DTD.
XML for XML documents that reference a DTD.
SGML for SGML documents.
After selecting the document type and pressing the button, you will be prompted for additional information in a second dialog:
The Document element is used to enter the name of the top-level element for your document. If you are creating an SGML document or an XML document with a DTD, the DTD must contain the definition of this element. Filling out this field is required.
The Document encoding field lets you specify the encoding for XML documents. This field is not available if you are creating an SGML document. It is recommended to accept the default encoding of UTF-8 for XML documents.
The System identifier field is used to enter the system identifier for your DTD. In most cases, this will be the file name of the DTD. This field is not available if you are creating a DTDless XML document.
This field is required for XML documents that use a DTD. For SGML documents, either a System identifier or a public identifier must be provided.
The Public identifier field is used to provide a public identifier for the DTD. Public identifiers are resolved using catalog files as described later in this document.
This field is not available if your are creating a DTDless XML document. Filling out this field is optional if you are creating an XML document with a DTD.
After providing the required information and pressing the button, a new document will be created.
To create a document from an existing template, choose the desired template from the list at the bottom of the dialog and click on the button.
After selecting the appropriate template and clicking the button, a new document is created with the information from this template. The document element is inserted in the new document and the insertion cursor is placed inside the document element.
If you need more information about an entry in this list, you can display a context menu by right-clicking on the template entry. From the context menu, you can
Get more information about the template (see below).
Rename or delete the template.
Change the icon for the template.
If you select from the context menu, a second dialog window (see Figure 15-3) will appear that contains more details about the template.
The example dialog shown in Figure 15-3 specifies that:
The template is stored in the file C:/Program Files/epcEdit/templates/DocBook412.sgt
The document type will be book, i.e. the document element that will be inserted by epcEdit when a new document is created will be of type book.
The DTD is referenced by a public identifier of -//OASIS/DTD DocBook XML V4.1.2//EN. This public identifier will be resolved by using the SGML/XML catalogs on your system. Please refer to chapter Catalogs for more details on catalogs.
There is an additional system identifier dtd/docbookx.dtd
No additional data will appear in the document prolog.
The Template Information dialog can be dismissed by clicking on the button or by closing the dialog window.
If you can not use one of the available templates, you will need to create a new template. New templates can be created on the fly from within the New Document dialog by selecting the the corresponding radio button and pressing the button. Choosing this option will start the Template Wizard for creating a new template. The Template Wizard is described in detail in Templates. After a new template has been created with the template wizard, this template will be used for creating a new document.
The command open a new epcEdit window. The new window will be initially empty and totally independent from the initial epcEdit window. It can be used just like the initial window that was displayed when epcEdit was started.
The title of the new window will appear as a new menu item in the menu. When multiple documents are edited in parallel in different windows, this provides a convenient way of switching between these documents. Please refer to The View menu for more details.
Using multiple epcEdit windows is preferred to starting multiple instances of epcEdit because an opening a new epcEdit window causes less load on your computer system than starting a new instance of the epcEdit program.
The command opens an existing document. When this command is invoked, epcEdit will display an Open File dialog for selecting the document file.
The document to open can be a valid or well-formed XML-Document or an SGML document. epcEdit will determine the type of document based on the filename extension and the structure of the document prolog:
If the filename has an extension of .xml, epcEdit will assume that the document is an XML document. The distinction between valid and well-formed XML documents depends on the occurrence of a DOCTYPE statement in the document prolog. If epcEdit finds a DOCTYPE statement, it will load the appropriate DTD and validate the document against this DTD while reading the document text. If no DOCTYPE is found in the prolog of the document, epcEdit will assume that the document in question is a well-formed XML document and no validation will be performed while the document is loaded.
If the filename of the document has an extension other than .xml, epcEdit will assume that the document is an SGML document that needs to contain a DOCTYPE statement and must be valid with respect to the DTD that is specified in the DOCTYPE statement.
A document that is loaded by epcEdit should be valid (for SGML documents and valid XML documents) or well-formed (for well-formed only XML documents). When parsing the document, epcEdit will tolerate some types of errors and try to correct them based on the information in the DTD. Other types of errors will cause epcEdit to refuse to load the document.
If correctable errors are found while loading a document, epcEdit will continue to load the document and try to fix the problems. After loading the document, epcEdit will open a dialog that shows a description of the errors that have been found.
The example dialog shown in Figure 15-4 contains the information that the end tag of a figure element occurred in the document before the element was complete.
The location at which the problem occurred can be shown by clicking on the button. When this button is clicked, epcEdit will highlight the element in which the error occurred and place the insertion cursor at the location of the error.
Additional information about the problem can be obtained by pressing the button. When this button is pressed, a second dialog will appear that contains more information about the problem.
The example message in Figure 15-5 states that:
The error occurred in the file example1.xml
The error occurred in column 2 of line 3 in this file
The error code assigned to this error is E071. This error code can be helpful when processing documents with other XML/SGML tools that are based on the SP system.
The Message Detail dialog is dismissed by clicking on the button.
The button in the validation dialog causes epcEdit to validate the loaded document again and to update the list of error messages. Because some errors can be corrected automatically, the loaded document may contain less errors than originally detected when the document was read. Other errors can not be corrected automatically and need to be fixed manually.
Severe errors will prevent epcEdit from loading a document. For example, epcEdit will refuse to load a valid XML or SGML document if the DTD can not be found. If severe errors are found in a document, epcEdit will display an appropriate error message and offer to open the document in text mode. See Text-mode editing for more details on text mode.
The example dialog in Figure 15-6 shows a situation where epcEdit tried to load a valid XML document with an invalid DTD specification. In this case, you have the option to load the document in text mode (by pressing the button) or to cancel the loading of the document (by clicking the button).
If you click on the button, epcEdit will load the document text in text mode where you can freely edit the document. Please refer to Text-mode editing for details on editing a document in text mode.
If you press the button, epcEdit will stop loading the document.
The command closes the currently open document.
If the document has been modified since it was last saved, epcEdit will display a dialog to ask you if you want to save the document before closing:
If you press the button, the document is saved in the file from which it was loaded. If the Create Backup File option (see Preferences) is set, any existing file with the same name will become a backup file before the document is saved.
If you press the button, the document is closed without saving and any unsaved changes to the document will be lost.
The button stops epcEdit from closing the document and you can continue working with the still-open document.
The command saves the current state of the currently open document to the file from which it was read. If the Create Backup File option (see Preferences) is set, any existing file with the same name will become a backup file before the document is saved.
Saving the document does not close the document; the document remains open and you can continue working with the document.
It is recommended to save your document regularly to avoid loosing changes.
If the Validate Before Save option is set, will validate your document every time that you use the command. If any errors occur while validating the document, the validation dialog (see ) will be displayed and (after dismissing the validation dialog) you will be prompted whether you still want to save the document :
If you click on the button, the document will be saved in it's current state, possibly overwriting a valid version of the same document. If you click on the button, the document will not be saved and you can correct any problems before saving.
It is recommended to make sure that a document is always in a valid state before saving the document. epcEdit and other XML or SGML processing tools may have problems in parsing or loading an invalid document.
The command lets you save a document under a different name or in different location.
The command will display a Save File dialog for selecting a filename and directory for saving the document. If a file the selected name already exists, epcEdit will ask you if you want to overwrite the existing file:
If you click the button, the existing file will be overwritten with the content of the current document. If you press the button, the document will not be saved and the existing file remains unchanged.
The command lets you specify the page dimensions for printing or exporting the document. In addition, these values will be used by the page layout display mode (if this mode is enabled in the menu).
In this dialog, you can specify the page margins, the page orientation, the paper dimensions, and the location of page numbers for printing the document.
The command lets you print the content of the current document.
Due to the different methods of printing in various operating systems, the exact behaviour of the print command is platform dependent. On Windows, the native Windows print system is used. On Unix and Linux platforms, the document is converted to PDF and sent to a PDF processing application for printing.
Invoking the command opens a system-specific dialog box for adjusting the print settings. On a Windows system, this dialog will look similar to the one below:
Pressing the button will start the printing process on the selected printer. If a part of the document is selected when the print command is invoked, the dialog will contain the option to print only the selected portion of the document. Additional, printer-dependent parameters can be changed by using the button.
Under Unix or Linux, the print dialog will look different.
The Printer command entry field contains the command for printing the document. The program that is started by this command must accept PDF data on its standard input and send the output to a printer in the appropriate format. If the prnt command contains the string %papersize, this string will be subsituted with the name of the selected paper format. If a custom paper size is selected, the replacement for the %papersize placeholder is the string wxh where w and h are replaced by the paper width and paper height (in points).
By default, the Adobe Acrobat reader is started for conversion to Postscript and the lpr command is expected to handle any required conversions to printer-specific formats. The Page Layout and Font Mapping tabs of this dialog correspond to the tabs in the PDF Export dialog. Please refer to Figure 15-13 for details.
The command lets you export the content of the current document as a PDF file.
This function provides an easy way for creating a readable, system-independent output format that can be printed from a PDF viewer like the Adobe Acrobat Reader. The output that is created by this function uses the built-in PDF fonts and contains a graphical representation of the markup icons in the document if they have not been turned off (see Document display).
Invoking the command opens a dialog box for adjusting the export parameters and for selecting the name of a file in which to store the PDF document. The generated PDF document can then be displayed by a PDF viewer.
The Export Options tab of the export dialog allows to select a filename. If a part of the document is selected when the command is invoked, you can choose between exporting the complete document and exporting only the selected portion of the document.
The possibility to create a PDF document be mistaken as a replacement for a high-quality style sheet processor that generates input for a typesetting system or for online-publishing.
The Page Layout tab contains the current page layout settings as defined with the command.
Changing these settings will affect the global page layout settings as well as the margins for the page view display mode.
The Font Mapping tab of the export dialog is used to specify mappings from the fonts in your document to the standard PDF fonts.
The left column in this dialog contains the names of the fonts that are used by your documents. The right column shows the substituted PDF font. To change the mapping for one these fonts, select the appropriate entry in the list and press the button to change the substituted font.
epcEdit remembers the names of the last documents that were opened and displays them in the history list in the file menu. To open one of these documents, it is sufficient to select the name of the document from the history list.
The command closes the epcEdit window in which it was invoked.
If the window that is to be closed contains an open document and this document has unsaved changes, epcEdit displays a dialog (see Figure 15-7) to ask you whether you want to save the document.
If you press the button, the document is saved in the file from which it was loaded. If the Create Backup File option (see Preferences) is set, any existing file with the same name will become a backup file before the document is saved.
If you press the button, the window is closed without saving the document and any unsaved changes to the document will be lost.
The button stops epcEdit from closing the window and you can continue to work in the still-open window.
If there is only one epcEdit window open, this option is disabled.
The command terminates epcEdit.
If any open documents contain unsaved changes, epcEdit will display a dialog box (see Figure 15-7) to ask you whether you want to save the document in question.
If you press the button, the document is saved in the file from which it was loaded before the window that contains the document is closed. If the Create Backup File option (see Preferences) is set, any existing file with the same name will become a backup file before the document is saved.
If you press the button, the window containing the document is closed without saving the document and any unsaved changes to the document will be lost.
The button stops epcEdit from exiting and you can continue to work with epcEdit.