Git Product home page Git Product logo

wkhtmltopdf's People

Contributors

amorriscode avatar aur1mas avatar clemherreman avatar georgyangelov avatar heliocorreia avatar leozandvliet avatar pataquets avatar referup-amontero avatar rikw22 avatar scintill avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

wkhtmltopdf's Issues

long content hands

For long content; exec function hangs :-(. with a simple function call "system" works.

Code fix:

protected function _exec($cmd, $input = "")
{
$result = array('stdout' => '', 'stderr' => '', 'return' => '');
system( $cmd, &$result['stdout'] );
return $result;
}

Header is not working

I am trying the header with this code.

 $wkhtmltopdf->setHeaderHtml('<div>This is header</div>');

but it generates error like below

WKHTMLTOPDF didn't return any data

can you help me?

Pragma misspelled

The pdf download code has

header("Pragme: public");

This appears to be a mis-spelling of Pragma

Session is not displaying all the data?

Hi,

I am converting HTML to pdf through wkhtmltopdf library, here session is behaving very differently that if we set the session when our link is called then it works fine but our previously set session is not getting?

exec('C://"Program Files"//wkhtmltopdf.exe ' . 'http://localhost/test.php?a=351' . ' ' . $file_name . '');

Problem:

Session set in test.php is available in this page when printing the page.
But if we set the session in some previous page e.g test2.php then that value is null here in test.php

Is any idea?

Sessions working strangely.

Suppose i create a session -> session_1 in browser_1 window(on my pc) and
second session -> session_2 in ,other, browser_2 window(on my pc) .

so when i try to execute

exec(" Path_to_wkhtmltoimage --cookie PHPSESSID session_1 My_url Save_to_path ");

in my file.php file, present on my server, on browser_1 . It doesn't execute (instead goes into an infinte loop, i guess, returning to some error 503 after some time around 5-10 mins) .
However it works fine if i run the same command in cmd on server.
And also it works fine if i run file.php, with same command as above, on browser_2 window ,that saves the screenshot image .

similarly, if i run

exec(" Path_to_wkhtmltoimage --cookie PHPSESSID session_2 My_url Save_to_path ");

in my file.php file on my server on browser_2 . it doesn't execute. But executes correctly in browser_1.

"file.php" is attached .
file.txt

please tell me , where am i doing wrong !!

sorry for confusion , if any.
Thanks in advance.

filepath missing in mode_save

On Line 618 instead of:
file_put_contents( $filename, $this->_render());

it should be:
file_put_contents($this->getPath() . $filename, $this->_render());

WKHTMLTOPDF didn't return any data

Hi there,
i'm trying to use your classe, but when o use it i do have this error, it create me a html file with my content but say that it do not receive any data :/

here's my code:
try {
$wkhtmltopdf = new Wkhtmltopdf(array('path' => './public/uploads/'));
$wkhtmltopdf->setTitle("Title");
$wkhtmltopdf->setHtml("

coucou
");
$wkhtmltopdf->output(Wkhtmltopdf::MODE_DOWNLOAD, "file.pdf");
} catch (Exception $e) {
echo $e->getMessage();
}

i also try with get_page_content, an url always same issue.

Thanks.

Possibility of deadlock in _exec

Today I had an issue where my application hung trying to create a PDF on Linux. Using strace and /proc/*/fd, I could see that the PHP application was blocked reading from wkhtmltopdf's stdout, and wkhtmltopdf was blocked writing to its stderr. Looking at the PHP code shows that nothing will be read from wkhtmltopdf's stderr until stdout has been read completely. I suspect the pipe buffer filled up, so that write(stderr, ...) would not return until the buffer was consumed, but since the PHP is blocked reading stdout, the buffer will never be emptied. This wouldn't happen with every PDF since there is a buffer, but presumably longer PDFs generate more output on stderr and hit the buffer limit.

I think one solution would be to use stream_select() to effectively read from both stdout and stderr at the same time. The input should probably be written the same way, as I'd imagine the output buffers could also fill up before the input is completely written. In my case my input is a file, so I don't know.

This may be the issue in #18, but there's not enough information to know.

TOC param is incorrect

line 251 is incorrect, it should be:

$command .= ($this->getTOC()) ? " toc" : "";

and put in after the "title" parameter

Output not fully written to file

Hi,

I was looking for a nice way to convert some HTML pages to pdf, and your class looks like a great way to work with wkhtmltopdf. After trying a few things i got it to output a pdf file, although those were corrupt.
When generating the same pdf through the command line it would output a correct pdf file, and while comparing the two it became clear the one generated by your class had been cut off.

I then found out if i would use strlen instead of mb_strlen for the content-length headers it would output correct pdf files.

Does anyone else have the same issue?

No Data Returned

Hi. So far I like your revision as it is much cleaner. But I keep getting the following exception thrown:

WKHTMLTOPDF didn't return any data

I am running WAMP and have installed the Windows installer of WKHTMLTOPDF but am unsure if your script will automatically see it. Could this be the problem?

Image support

I'm using this class and the images doen't appear. The css support works very well.

I tried use absolute path and relative path but doen't work

Problem with charts/javascript

Hi there,

I'm using this wrapper (aur1mas / Wkhtmltopdf) and works fine with pages such as google, bbc, hotmail. But when I use it with pages with graphics/charts (such as https://developers.google.com/chart/) with javascript, it doesn't show up.

If I use wkhtmltopdf from terminal it works perfect.

I'm using wkhtmltopdf-0.11.0.

Any help will be highly appreciated.

Diego

CSS ignored

When I try to generate the PDF using Wkhtmltopdf class. It ignores CSS. And if i try to generate the PDF via terminal then only it generates PDF properly. So, what could be the problem?

Problem with headers?

Hi, i was using this php implementation, which worked almost right out of the box for me. But then i passed to the static 64bits version of wkhtmltopdf, and it juste keep on giving me supposedly server internal error. Checked lots of things, and im starting to think the headers, in download mode, are responsible.

Does anyone know if headers can crash on some servers? cause the command works really fine and get me back pdf datas.

thx

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.