Skip to content
This repository has been archived by the owner on Jun 6, 2020. It is now read-only.

(Tuto) How to run this library on OS/X ? #3

Closed
kaleidoscopique opened this issue Aug 10, 2015 · 2 comments
Closed

(Tuto) How to run this library on OS/X ? #3

kaleidoscopique opened this issue Aug 10, 2015 · 2 comments

Comments

@kaleidoscopique
Copy link

Hi Mochamad,

Thanks a lot for this awesome library !

I was writing a big ticket where I asked "HELPP, can you help me to run your lib on OS/X please ?" but by writing my issue, I've found the solution ! Then I thought it will be a good idea to share the tips.

1. Install brew
Brew is a famous package manager on OS/X : http://brew.sh/ (aptitude style).

2. Install poppler

brew install poppler

3. Verify the path of pdfinfo and pdftohtml

$ which pdfinfo
/usr/local/bin/pdfinfo

$ which pdftohtml
/usr/local/bin/pdfinfo

4. Whatever the paths are, use Gufy\PdfToHtml\Config::set to set them in your php code. Obviously, use the same path as the one given by the which command;

<?php
// if you are using composer, just use this
include 'vendor/autoload.php';

// change pdftohtml bin location
\Gufy\PdfToHtml\Config::set('pdftohtml.bin', '/usr/local/bin/pdftohtml');

// change pdfinfo bin location
\Gufy\PdfToHtml\Config::set('pdfinfo.bin', '/usr/local/bin/pdfinfo');

// initiate
$pdf = new Gufy\PdfToHtml\Pdf('file.pdf');

// convert to html and return it as [Dom Object](https://github.com/paquettg/php-html-parser)
$html = $pdf->html();
?>

Everything will work like a charm ! :-)
Stéphane

@kaleidoscopique kaleidoscopique changed the title (Tuto) How to run this library on OS/X with MAMP ? (Tuto) How to run this library on OS/X ? Aug 10, 2015
@mgufrone
Copy link
Owner

Ah, that's great help. Thanks, allow me to include your guide in my README file. 👍

@kaleidoscopique
Copy link
Author

Of course ! :-) See you soon, have a nice day.
@+ Stéphane

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants