Sha256: 1915b416bd73101b68266dcf9331d2a354ae6e7b47d500d6d10c2c8309e875f9

Contents?: true

Size: 1.11 KB

Versions: 1

Compression:

Stored size: 1.11 KB

Contents

# MuPDF

[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/ksylvest/mupdf/blob/main/LICENSE)
[![RubyGems](https://img.shields.io/gem/v/mupdf)](https://rubygems.org/gems/mupdf)
[![GitHub](https://img.shields.io/badge/github-repo-blue.svg)](https://github.com/ksylvest/mupdf)
[![Yard](https://img.shields.io/badge/docs-site-blue.svg)](https://mupdf.ksylvest.com)
[![CircleCI](https://img.shields.io/circleci/build/github/ksylvest/mupdf)](https://circleci.com/gh/ksylvest/mupdf)

## Installation

```bash
gem install mupdf
```

## Usage

### Document

A `MuPDF::Document` wraps a PDF file:

```ruby
document = MuPDF::Document.new('./file.pdf')
```

#### Info

The `info` command displays information about the document such as the number of pages:

```ruby
info = document.info
info.pages # e.g. 2
```

#### Pages

The `pages` command finds sizing information about the pages within a document:

```ruby
pages = document.pages
pages.count # e.g. 2
page = pages[0]
page.pagenum # 1
box = page.media_box # page.crop_box / page.bleed_box / page.trim_box / page.art_box
box.width # 612
box.height # 792
```

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
mupdf-0.4.0 README.md