Disabling the Windows Print-dialog ?

2006-08-12 18:48:29 by zagrad

Hi,

What I am trying to do is the following, but I have no idea if it is going to work. It's worth the try though.

1. In PHP I create an HTML-file and write that to the disk (on the server).
2. Then I call PDFCreator commandline and create a PDF from this HTML-file.
3. Next I can let a user download the pdf-file.

At step 2 my script hangs though and I think this is because PDFCreator tries to open up the print-dialog. Also when I print via the commandline with /NoStart the print-dialog still comes up. So what's the use of it then anyway??

Is there a way to get rid of this and let PDFCreator do it's job completely in the background?

Thanks in advance,
Paul


2006-08-13 07:46:37 by thesmilyface

Hello Paul,

I think the best way is to use the com interface via php.

Frank


2006-08-13 13:34:29 by zagrad

Hi,

Thanks for your reply. According to the manual indeed I now see I should probably use the COM-interface.

Though: I had no idea what COM is or how to use it in PHP.
Right now I am reading all about it, so you've probably helped me out a lot :) Thank you.

For other people who might be interested:
http://www.php.net/manual/ref.com.php

Grtz,
Paul


2006-08-13 14:31:46 by zagrad

Hi,

Since there is no documentation on how to use the PDFCreator COM object in PHP, I am now rewriting the VB-code to PHP.

I am a little bit stuck though. In VB is the code:
oPDFC.cOption("AutosaveFormat") = 0

Now my question is: What does this mean? Is cOption an array with property "AutosaveFormat" ? Or is it some kind of function?

This gives a syntax-error in PHP (duh):
$PDFC->cOption("AutosaveFormat") = 0;

And this gives an error-msg about the fact that cOption needs a paramter (as in that cOption is a function):
$PDFC->cOption["AutosaveFormat"] = 0;

Could someone help me out here?

Gr,
Paul


2008-08-20 22:56:20 by farole

Hi Paul,

I know the answer maybe stranger but try rename the html file to .doc (yes, a word document) I try here and works!!

Fausto