From df16249900225fe0a1563ae4c1e5603652abea21 Mon Sep 17 00:00:00 2001 From: Andreas Heigl Date: Wed, 25 May 2016 09:48:08 +0200 Subject: [PATCH] Adds more documentation --- README.md | 9 +++++++-- doc/index.md | 7 ++++++- doc/usage.md | 30 ++++++++++++++++++++++++++++++ mkdocs.yml | 2 ++ 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 doc/usage.md diff --git a/README.md b/README.md index 3af0110..8e7109c 100644 --- a/README.md +++ b/README.md @@ -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 + ``` 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'; +} +``` \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index d8744c4..fc0cb57 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -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'