> For the complete documentation index, see [llms.txt](https://docs.apryse.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.apryse.com/cli/pdf-cosedit/usage.md).

# Usage Examples for CosEdit

Discover how to navigate the PDF file structure with CosEdit's intuitive GUI. Learn about the header, body, cross-reference table, and trailer elements for efficient low-level PDF editing. The Apryse

Apryse’s **CosEdit** is a stand-alone desktop application for low-level PDF editing. This section covers the basic use of CosEdit explaining all the available options.

![](https://2406472477-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqKEEHupUnsxhXQwTzkVi%2Fuploads%2Fgit-blob-8ab4327cfd4754b76c6303d5840982bc2fe9543a%2F7e2f81d73899dfe17878597cb9302fde0985dd9e-400x315.png?alt=media)

## Mapping the PDF File Structure to CosEdit User Interface

CosEdit’s graphical user interface (GUI) has a clean mapping of the PDF file structure. For a details on the PDF file structure, please refer to the latest PDF Reference Manual.

To summarize, a PDF file consists of four sections:

* A one-line **header** identifying the version of the PDF specification to which the file conforms.
* A **body** containing the objects that make up the document contained in the file.
* A **cross-reference table** containing information about the indirect objects in the file.
* A **trailer** giving the location of the cross-reference table and certain special objects within the body of the file.

This initial structure may be modified by later updates, which append additional elements to the end of the file.

The following figure illustrates how the basic PDF file structure is mapped to CosEdit's GUI.

![](https://2406472477-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqKEEHupUnsxhXQwTzkVi%2Fuploads%2Fgit-blob-f2422053361a2b09b538538a169092b6da5402c3%2F776527ab9d5082813e7199a9faf8a017c69f70ea-450x252.png?alt=media)

Cross-reference table elements map directly to the entries in the cross-reference table (xref) view. Xref View displays, in a tabular form, all elements from the latest cross-reference table. Columns of the table contain useful information about the indirect object such as its type, file offset, object, generation number, etc.

File body is a container of indirect objects. Indirect objects can refer to each other forming a graph- like structure. The root of the graph is the trailer object. In CosEdit, the trailer can always be located by selecting the first row of the Xref View (or by clicking on the 'root' button in the toolbar).

Selecting rows in the Xref View will display corresponding objects in the Object View that is located to the right. The Object View displays the value of the selected indirect object. You can use the Object View to modify existing objects and, in the case of container objects (i.e. dictionaries and arrays), create direct sub-objects as well as references to other indirect objects. References to indirect objects can be easily identified as icons containing the L (as in Link) symbol.

Double clicking on the link will select the referenced element in the Xref and Object View. Effectively, clicking on the link allows you to navigate the [Cos](/cli/pdf-cosedit/faq.md#what-is-cos) object graph. The History Bar shown in the figure below illustrates the current position in the graph starting from the specific indirect object.

![](https://2406472477-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FqKEEHupUnsxhXQwTzkVi%2Fuploads%2Fgit-blob-f3bc936da34efff4efbc37d7c5bd8c8fd215602a%2Fc5de1d94f45ef8656210f509015491eb87db013c-500x96.png?alt=media)

You can use the left and right arrow buttons to go back and forth through position history, or you can directly edit the path as in a web browser.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.apryse.com/cli/pdf-cosedit/usage.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
