File tree 4 files changed +45
-3
lines changed
4 files changed +45
-3
lines changed Original file line number Diff line number Diff line change 5
5
6
6
A PHP-wrapper to the Ghostscript-CLI
7
7
8
- ## Installation: |
8
+ ## Installation
9
9
10
10
This package is best installed using [ composer] ( https://getcomposer.org ) .
11
11
12
12
composer require org_heigl/ghostscript
13
13
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
+
15
20
```
16
21
<?php
17
22
use Org_Heigl\Ghostscript\Ghostscript;
Original file line number Diff line number Diff line change @@ -4,4 +4,9 @@ A wrapper to the Ghostscript-CLI
4
4
5
5
## Installation
6
6
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 )
Original file line number Diff line number Diff line change
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
+ ```
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ docs_dir: doc
2
2
site_dir : build/html
3
3
pages :
4
4
- index.md
5
+ - " Usage " :
6
+ - " Basic Usage" : usage.md
5
7
site_name : Org_Heigl\Ghostscript
6
8
site_description : A wrapper to the Ghostscript CLI
7
9
repo_url : ' https://github.com/heiglandreas/Org_Heigl_Ghostscript'
You can’t perform that action at this time.
0 commit comments