Comments (12)
finally thanks @mgufrone this is the working code i have
Config::set('/usr/bin/pdftohtml.bin', '/var/www/html/poppler-0.51/bin/pdftohtml.exe');
// change pdfinfo bin location
Config::set('/usr/bin/pdfinfo.bin', '/var/www/html/poppler-0.51/bin/pdfinfo.exe');
thanks a lot
from pdf-to-html.
These codes :
\Gufy\PdfToHtml\Config::set('pdftohtml.bin', '/pdf/');
\Gufy\PdfToHtml\Config::set('pdfinfo.bin', '/pdf/');
are supposed to determine where you locate pdftohtml binary file. so you should appoint it to the binary file, not the directory.
To find it out, you should use
which pdftohtml
which pdfinfo
then use each of locations and insert to the code above. You got what i mean? ๐
from pdf-to-html.
@mgufrone,
thanks for the reply. I have updated installed Poppler-Utils and updated my codes according to
which pdftohtml
which pdfinfo
Like this
\Gufy\PdfToHtml\Config::set('pdftohtml.bin', '/usr/local/bin/pdfinfo');
\Gufy\PdfToHtml\Config::set('pdfinfo.bin', '/usr/local/bin/pdftohtml');
$pdf = new \Gufy\PdfToHtml\Pdf('/home/vagrant/Code/fyp/public/pdf/testing.pdf');
but it returns this error
ErrorException in Pdf.php line 51:
Undefined index: pages
and when i dd($pdf); it returns null
Can you guide me on the right way of calling the pdf file?
Appreciate your help
Cheers
Ralee
from pdf-to-html.
I believe you accidentally flip this code
\Gufy\PdfToHtml\Config::set('pdftohtml.bin', '/usr/local/bin/pdfinfo');
\Gufy\PdfToHtml\Config::set('pdfinfo.bin', '/usr/local/bin/pdftohtml');
It suppose to be like this
\Gufy\PdfToHtml\Config::set('pdftohtml.bin', '/usr/local/bin/pdftohtml');
\Gufy\PdfToHtml\Config::set('pdfinfo.bin', '/usr/local/bin/pdfinfo');
Try it again, if it still gives you error, i will check it again.
from pdf-to-html.
Hey @mgufrone,
Nope flipping it doesnt work. Thanks for helping me.
Same error
ErrorException in Pdf.php line 51:
Undefined index: pages
Cheers,
Ralee
from pdf-to-html.
Hey @mgufrone,
Any news?
Cheers
Ralee
from pdf-to-html.
will give you notice again on a weekend. i hope it will be good news for you.
from pdf-to-html.
I managed to have it worked. I installed poppler utils on my local instead of my virtual machine... Great its working now! Do you know how i can retrieve the html content?
Great library btw. I am gonna star it now.
Cheers
Ralee
from pdf-to-html.
Glad you made it @ThomasRalee ๐
Thank you for using this library.
from pdf-to-html.
Hi @mgufrone
Thanks for the great script .
I am getting the same error as above.I have installed sudo apt-get install poppler-utils on local machine.But still getting the same error can you please tell me what else i have to do to convert from PDF to HTML?
Here is code
\Gufy\PdfToHtml\Config::set('pdftohtml.bin', '/usr/local/bin/pdfinfo');
\Gufy\PdfToHtml\Config::set('pdfinfo.bin', '/usr/local/bin/pdftohtml');
$viewPdf=public_path().'/assets/uploads/pdf/1dummy.pdf';
// initiate
$pdf = new Pdf($viewPdf);
// convert to html string
$html = $pdf->html();
from pdf-to-html.
@ThomasRalee can you please tell me all the configuration settings has been done for using it with laravel
Thanks in advance!!
from pdf-to-html.
<!DOCTYPE html>
<html>
<head>
<title></title>
</head>
<body>
<?php
use \Gufy\PdfToHtml\Pdf;
use \Gufy\PdfToHtml\Html;
$viewPdf= storage_path('app/public/sample2.pdf');
$pdf = new \Gufy\PdfToHtml\Pdf($viewPdf);
\Gufy\PdfToHtml\Config::set('pdftohtml.bin',storage_path('/app/public/poppler/bin/pdftohtml.exe'));
\Gufy\PdfToHtml\Config::set('pdfinfo.bin',storage_path('/app/public/poppler/bin/pdfinfo.exe'));
$pdf = new Pdf($viewPdf);
$pdfDom = $pdf->getDom(['ignoreImages' => true]);
// convert to html string
$html = $pdf->html();
$dom = $pdf->getDom();
$total_pages = $pdf->getPages();
$paragraphs = $dom->find('body > p');
echo $html;
echo $total_pages;
// echo $paragraphs;
?>
</body>
</html>
worked for me!
download poppler from here - https://blog.alivate.com.au/poppler-windows/
-happy coding jineshsubedi.com.np
from pdf-to-html.
Related Issues (20)
- taking extra spaces in html
- How to handle special chars?
- Setting the generate image path HOT 2
- How can i change image src path? HOT 1
- Notice: Undefined index: pages HOT 5
- Why is this issue?
- Landscape document HOT 1
- Error exception when converting pdf to html file on window machine?
- Treatment of HTML generated file
- Ubuntu pdftohtml and pdfinfo not present.
- pdftohtml conversion only converting the 1st page or even less than that. HOT 1
- vendor/gufy/pdftohtml-php must have write access HOT 1
- It extension is work on the dedicated linux server?
- mb_eregi_replace() Error HOT 1
- HTML Output Class meaning
- PHP 7.1 + Compatibility HOT 5
- Class 'Gufy\PdfToHtml\Config' not found
- The text of PDF is being rendered as image HOT 2
- ะกount(): Parameter must be an array or an object that implements Countable HOT 6
- No styles for classes like ft00, ft01 etc.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pdf-to-html.