This forum is in READ-ONLY mode.
You can look around, but if you want to ask a new question, please use the new forum.
Home » legacy support » symfony 1.2 » how to print a pdf file
how to print a pdf file [message #102744] Mon, 19 July 2010 15:15 Go to next message
benakacha  is currently offline benakacha
Messages: 18
Registered: August 2009
Junior Member
hello,
I use the dompdf to export an html page to pdf format here is my code
include ("js/dompdf_config.inc.php");
$html = file_get_contents(sfConfig::get ( 'sf_web_dir' ).'/../lib/PDFTemplates/priceOffert.html');

$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
$dompdf->stream("sample.pdf");

I seek to create a link to print the pdf file without opening the file generating ?
cordially.

[Updated on: Mon, 19 July 2010 15:16]

Re: how to print a pdf file [message #102748 is a reply to message #102744 ] Mon, 19 July 2010 15:33 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
For the web user, this is not possible. You can link to a PDF file, which either can be opened in a default desktop viewer or a browser plugin, but for very good reasons you can't get it to print without the user using the Print... dialogue.

You can of course send the PDF to a printer on the +web server+ without any intervention, but I am guessing that's not what you want.

[Updated on: Mon, 19 July 2010 15:33]


Remember Palestine
Re: how to print a pdf file [message #102758 is a reply to message #102748 ] Mon, 19 July 2010 15:55 Go to previous messageGo to next message
benakacha  is currently offline benakacha
Messages: 18
Registered: August 2009
Junior Member
I already find a way to save the pdf file in the server
$pdf = $dompdf->output("PDFOffrePrix");
file_put_contents("saved_pdf.pdf", $pdf);
it lacks a script or a java-script php treatment that provides access to the file and print
Re: how to print a pdf file [message #102765 is a reply to message #102744 ] Mon, 19 July 2010 16:13 Go to previous messageGo to next message
halfer  is currently offline halfer
Messages: 9535
Registered: January 2006
Location: West Midlands, UK
Faithful Member
... which is NOT possible - for security reasons, fortunately!


Remember Palestine
icon6.gif  Re: how to print a pdf file [message #102769 is a reply to message #102765 ] Mon, 19 July 2010 16:49 Go to previous message
benakacha  is currently offline benakacha
Messages: 18
Registered: August 2009
Junior Member
you have the reason I let the user the printing stage as usual File>> Print Shocked , I want to thank you for your help by Shocked
Previous Topic:Called to undefined method error
Next Topic:sfPropelBehavior::registerHooks and doSelect
Goto Forum:
  

powered by FUDforum - copyright ©2001-2004 FUD Forum Bulletin Board Software