Page 2 of 2
Re: Massive PDF's file printing
Posted: Tue Sep 14, 2010 9:22 pm
by Jonah Bron
mikosiko wrote:Jonah Bron wrote:What happens when you just run it right from the terminal?
if you mean the command than I'm using it print the file perfectly (silent No GUI)... same if I use AcroRead32 or NitroPdf or any other pdf viewer
I don't quite understand. You're saying it prints properly if you type that command right into the terminal?
Re: Massive PDF's file printing
Posted: Wed Sep 15, 2010 1:40 am
by VladSun
Sounds like permission issues ...
Re: Massive PDF's file printing
Posted: Wed Sep 15, 2010 10:41 am
by buckit
VladSun wrote:Sounds like permission issues ...
was just going to say that. bet the user for the apache process doesn't have the same permissions as the exe. now this is a much more common thing to happen in linux than windows so could easily not be that. but its worth a look.
Re: Massive PDF's file printing
Posted: Wed Sep 15, 2010 11:22 am
by mikosiko
Jonah Bron wrote:
...
I don't quite understand. You're saying it prints properly if you type that command right into the terminal?
Yes
Re: Massive PDF's file printing
Posted: Wed Sep 15, 2010 11:25 am
by mikosiko
VladSun wrote:Sounds like permission issues ...
In windows? ... any kind that you are aware of? (I'm working with and account with administrative privileges)
Re: Massive PDF's file printing
Posted: Wed Sep 15, 2010 11:34 am
by Weirdan
mikosiko wrote:(I'm working with and account with administrative privileges)
But apache, most likely, works under different account like NETWORK SERVICE. You can check what account is used by the program via task manager.
Re: Massive PDF's file printing
Posted: Wed Sep 15, 2010 12:20 pm
by mikosiko
Weirdan wrote:
But apache, most likely, works under different account like NETWORK SERVICE. You can check what account is used by the program via task manager.
I did check that too Weirdan... Apache is running as a windows service with "Logon As"=Local System... in task manager the httpd process shows as running under the "SYSTEM" username.
I'm lacking of more ideas at this point... maybe is time to just look for a different solution

Re: Massive PDF's file printing
Posted: Thu Sep 16, 2010 2:41 am
by JakeJ
Here's an idea to try to nail down where the problem is coming from...
Try executing a different windows process with the same code. For example, rather than printing, try opening the calculator or something. If it works, then you don't have a permissions issue, you have a printing issue.
But just for kicks, try giving the apache service administrator rights. Just don't leave it like that.
what if you created a batch file that would execute if from the command prompt and then use exec() to execute the batch file? It's a bit kludgy but it might work.
[SOLVED] Massive PDF's file printing
Posted: Thu Sep 16, 2010 8:45 am
by mikosiko
thank you for the suggestions Jake... I had tried all of them already... same results every time.. I'm definitely inclined to the permits issue too but I'm failing to detect where and how to solve it.

... I'm just calling the week off in this one

maybe a good week end rest, plus a couple rounds of golf hitting that little freaking ball will give me some new ideas
EDIT SOLVED: Well seems that thinking in the week-end golf round made the trick!!

I found the solution... was not a permit issue after all (but definitely is something to have in mind)... what is was that when exec() (or shell_exec or backtick) was executing the PDFXchange.exe it was not recognizing the default printer as existent, therefore the solutions was to write this line:
Code: Select all
$printcmd = `PDFXCHANGE.exe /print $file`;
in this way:
Code: Select all
$printer = "thename of the printer here";
$printcmd = `PDFXCHANGE.exe /print:printer=\"$printer\" $file`;
Note: I did test with a local printer and also with a network printer (using FQN), both work perfectly.
Thanks everyone's suggestions... they definitely helped... specially the one mentioning "printing issue"
