I am using dompdf with out any worries. But the problem is I am not able to generate a pdf in landscape mode. Does any one of you have an idea? Is there anyone who have used this software and would like to suggest me a way to do this?
I am using dompdf with out any worries. But the problem is I am not able to generate a pdf in landscape mode. Does any one of you have an idea? Is there anyone who have used this software and would like to suggest me a way to do this?
Code:$html = "<html><head><title>my html</title></head><body>foo</body></html>"; $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->set_paper("a4", "landscape" ); $dompdf->render(); $dompdf->stream("mail.pdf" );
That's all and to put in portrait :
Code:$dompdf->set_paper("a4", "portrait" );
I'm trying desperately to install dompdf. Can you help me?
- I install the dompdf folder on the root of my site (more precisely in a subfolder for testing). I put all rights on this issue.
But then what? What we put on the page + for a link to generate the pdf? I'm looking everywhere on the web but do not found any solution. And on the official site, I do not understand.
That is indicated in the header file dompdf.php:
/**
* Display command line usage:
*
* Usage: ./dompdf.php [options] html_file
*
* html_file can be a filename, a url if fopen_wrappers are enabled, or the '-'
* character to read from standard input.
*
* Options:
* -h Show this message
* -l list available paper sizes
* -p size paper size; something like 'letter', 'A4', 'legal', etc. The default is
* 'letter'
* -o orientation either 'portrait' or 'landscape'. Default is 'portrait'.
* -b path set the 'document root' of the html_file. Relative urls (for
* stylesheets) are resolved using this directory. Default is the
* directory of html_file.
* -f file the output filename. Default is the input [html_file].pdf.
* -v verbose: display html parsing warnings and file not found errors.
* -d very verbose: display oodles of debugging output: every frame in the
* tree is printed to stdout.
*
*
*/
Bookmarks