Skip to content

Commit

Permalink
Adds more documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
heiglandreas committed May 25, 2016
1 parent 5a342ed commit df16249
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 3 deletions.
9 changes: 7 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,18 @@

A PHP-wrapper to the Ghostscript-CLI

## Installation: |
## Installation

This package is best installed using [composer](https://getcomposer.org).

composer require org_heigl/ghostscript

## Usage: |
## Documentation

You can find the documentation for the library at https://heiglandreas.github.io/Org_Heigl_Ghostscript

## Usage

```
<?php
use Org_Heigl\Ghostscript\Ghostscript;
Expand Down
7 changes: 6 additions & 1 deletion doc/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,9 @@ A wrapper to the Ghostscript-CLI

## Installation

This library is best installed using [composer](https://getcomposer.org)
This library is best installed using [composer](https://getcomposer.org)

## Further Documentation

* [API (DocBlock)](api/)
* [Code-Coverage](https://coveralls.io/github/heiglandreas/Org_Heigl_Ghostscript)
30 changes: 30 additions & 0 deletions doc/usage.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Basic usage

## Convert a PDF- or Postscript-File to a JPEG

```
<?php
use Org_Heigl\Ghostscript\Ghostscript;
// Create the Ghostscript-Wrapper
$gs = new Ghostscript ();
// Set the output-device
$gs->setDevice('jpeg')
// Set the input file
->setInputFile('path/to/my/ps/or/pdf/file')
// Set the output file that will be created in the same directory as the input
->setOutputFile('output')
// Set the resolution to 96 pixel per inch
->setResolution(96)
// Set Text-antialiasing to the highest level
->setTextAntiAliasing(Ghostscript::ANTIALIASING_HIGH);
// Set the jpeg-quality to 100 (This is device-dependent!)
->getDevice()->setQuality(100);
// convert the input file to an image
if (true === $gs->render()) {
echo 'success';
} else {
echo 'some error occured';
}
```
2 changes: 2 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ docs_dir: doc
site_dir: build/html
pages:
- index.md
- "Usage":
- "Basic Usage" : usage.md
site_name: Org_Heigl\Ghostscript
site_description: A wrapper to the Ghostscript CLI
repo_url: 'https://github.com/heiglandreas/Org_Heigl_Ghostscript'
Expand Down

0 comments on commit df16249

Please sign in to comment.