Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
418 views
in Technique[技术] by (71.8m points)

wkhtmltopdf - Execute command line via php?

How I can execute those two command line via php:

wkhtmltopdf www.google.com gg.pdf

&

oofice -headless -nologo -pt cup-pdf my.doc

they both return a pdf file and download into my home directory.

I want to know the way to execute those command from my html page via php.

Thanks.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

You should take a look at the System program execution section of the manual : PHP provides several functions that can be used to launch external commands / programs, including :

  • exec() -- which can store the output of the command in an array
  • shell_exec() -- which returns, as a string, the output of the command
  • system() -- which echoes the output of the command

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...