Skip to content

Commit df16249

Browse files
committed
Adds more documentation
1 parent 5a342ed commit df16249

File tree

4 files changed

+45
-3
lines changed

4 files changed

+45
-3
lines changed

README.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@
55

66
A PHP-wrapper to the Ghostscript-CLI
77

8-
## Installation: |
8+
## Installation
99

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

1212
composer require org_heigl/ghostscript
1313

14-
## Usage: |
14+
## Documentation
15+
16+
You can find the documentation for the library at https://heiglandreas.github.io/Org_Heigl_Ghostscript
17+
18+
## Usage
19+
1520
```
1621
<?php
1722
use Org_Heigl\Ghostscript\Ghostscript;

doc/index.md

+6-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,9 @@ A wrapper to the Ghostscript-CLI
44

55
## Installation
66

7-
This library is best installed using [composer](https://getcomposer.org)
7+
This library is best installed using [composer](https://getcomposer.org)
8+
9+
## Further Documentation
10+
11+
* [API (DocBlock)](api/)
12+
* [Code-Coverage](https://coveralls.io/github/heiglandreas/Org_Heigl_Ghostscript)

doc/usage.md

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Basic usage
2+
3+
## Convert a PDF- or Postscript-File to a JPEG
4+
5+
```
6+
<?php
7+
use Org_Heigl\Ghostscript\Ghostscript;
8+
9+
// Create the Ghostscript-Wrapper
10+
$gs = new Ghostscript ();
11+
12+
// Set the output-device
13+
$gs->setDevice('jpeg')
14+
// Set the input file
15+
->setInputFile('path/to/my/ps/or/pdf/file')
16+
// Set the output file that will be created in the same directory as the input
17+
->setOutputFile('output')
18+
// Set the resolution to 96 pixel per inch
19+
->setResolution(96)
20+
// Set Text-antialiasing to the highest level
21+
->setTextAntiAliasing(Ghostscript::ANTIALIASING_HIGH);
22+
// Set the jpeg-quality to 100 (This is device-dependent!)
23+
->getDevice()->setQuality(100);
24+
// convert the input file to an image
25+
if (true === $gs->render()) {
26+
echo 'success';
27+
} else {
28+
echo 'some error occured';
29+
}
30+
```

mkdocs.yml

+2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ docs_dir: doc
22
site_dir: build/html
33
pages:
44
- index.md
5+
- "Usage":
6+
- "Basic Usage" : usage.md
57
site_name: Org_Heigl\Ghostscript
68
site_description: A wrapper to the Ghostscript CLI
79
repo_url: 'https://github.com/heiglandreas/Org_Heigl_Ghostscript'

0 commit comments

Comments
 (0)