---
Product: Aspose.PDF
Platform: go
Page Type: docs
Canonical URL: https://docs.aspose.org/pdf/go/getting-started/quickstart
---

# Quick Start

Open an existing PDF, split it into pages, and merge two documents using the Document, Page, and Append API in Aspose.PDF FOSS for Go.

## Overview

This page shows the minimal code to open a PDF, inspect its pages, and perform
split and merge operations using `Document`.

---

### Prerequisites

Before running the examples, complete [Installation](../installation/).

---

### Open and Inspect a PDF

`pdf.Open` opens an existing file and returns a `*Document`. Call `PageCount` to
read the number of pages.

```go
package main

import (
	"fmt"
	pdf "github.com/aspose-pdf-foss/aspose-pdf-foss-for-go"
)

func main() {
	doc, err := pdf.Open("sample.pdf")
	if err != nil {
		panic(err)
	}
	fmt.Printf("Loaded PDF with %d pages\n", doc.PageCount())
}
```

---

### Split Into Per-Page Files

`Document.Split` divides the document into one `*Document` per page.

```go
doc, _ := pdf.Open("report.pdf")
pages, _ := doc.Split()

for i, p := range pages {
	p.Save(fmt.Sprintf("page_%03d.pdf", i+1))
}
fmt.Printf("Split into %d pages\n", len(pages))
```

---

### Merge Multiple PDFs

`Document.Append` appends all pages from a second document in-place.

```go
base, _ := pdf.Open("part1.pdf")
part2, _ := pdf.Open("part2.pdf")
base.Append(part2)
base.Save("merged.pdf")
```

---

### Create a New Document

`pdf.NewDocumentFromFormat` creates a blank `*Document` with the given page format.

```go
doc := pdf.NewDocumentFromFormat(pdf.PageFormatA4)
doc.Save("blank.pdf")
```

---

### Next Steps

- [Developer Guide](../../developer-guide/) — encryption, forms, tables, bookmarks, annotations
- [API Reference](https://reference.aspose.org/pdf/go/) — full class and function listing
- [KB Articles](https://kb.aspose.org/pdf/go/) — how-to guides for specific tasks

## See Also

- [Aspose.PDF — Enterprise Documentation](https://docs.aspose.com/pdf/)