|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi fellow programmers,
I desperately need advice regarding the following, sorry if it is a bit lengthy : In short, currently I have a program written in Visual Basic for windows that does the following : - Get and holds detailed printer information and stores it in a pre-defined Structure - Gets and holds print jobs¡¯ detailed information in the window printer queue in a pre-defined Structure - Sends a print job from one printer queue to another - Allows the above to be done on a local network Note: the above program uses A LOT of pre-defined win32 APIS and the structures and most of the functions used are already defined by the language itself. Now, I am given the task to transfer this program to PHP language and the program must be able to work on Windows & Linux platforms. I¡¯ve did a bit of reading on PHP myself, but I can¡¯t seem to be able to find comprehensive functions for interacting between the platform & printer. Or maybe I missed it! Does PHP has extensive pre-defined functions/classes/librabries/whatever-you-call-it for interacting with the printer ? e.g. Libraries in JAVA, Win32 APIs in VB I¡¯m completely new to Linux, any advice would be appreciated. If PHP isn¡¯t suitable for this task, can you guys recommend a language to me? The language must be able to get detailed print job/printer information on Windows & linux platform. Thanks a zillion in advance!! Druda |
|
#2
|
|||
|
|||
|
There is a JAVA extension, as well as W32API and Printer
http://php.net/java http://php.net/printer http://php.net/w32api Also, what you could do is just use system()/exec() in PHP and port your other code to say c, or C++
__________________
Eric Coleman - Co-Owner ZaireWeb Solutions eric.coleman@zaireweb.com http://sitemod.net - sitemodCMS Coming Soon! |
|
#3
|
|||
|
|||
|
Quote:
Hi Zaireweb, thanks for your reply! i heard the w32APIS and all that only work for Windows based OS. but my program needs to be able to commnuicate with both. currently, i am not sure how the system()/exec() in PHP part works, but i was wondering that could achieve a cross platform program without having to write 2 different set of codes? |
|
#4
|
|||
|
|||
|
Write your code in Java, and use PHP to interface with it
![]() |
|
#5
|
|||
|
|||
|
Quote:
wow.. you reply REAL fast hmm.. if i do that, would i be able to make the program communicate with the workstations' printer installed on both windows & linux ? |
|
#6
|
|||
|
|||
|
Im pretty sure Java has printer API built in, so I don't see the problem with it..
And yes you can use it on either one.. just make sure you have the Java Extension setup for PHP on both systems.. and it will be perfectly portable |
|
#7
|
|||
|
|||
|
Hi Eric,
saw your name from your signature.. thanks for replying again.. hmm.. frankly i am totally alien about what you are saying because i havent touch the PHP langauge itself, just doing preparation work.. i heard from some that PHP is a server langauge.. i suspect this would make my task more difficult. ![]() hmm.. can i just compile the program to a .exe file & just run it on a central PC networked to the other PCs..? meaning this program would be a local program. or else how do i go about it? sorry, i am asking such silly questions, but i am really new to this PHP thingy.. thanks x infinity ~ |
|
#8
|
|||
|
|||
|
Oh, so you want just a stand-alone executable that works on either system?
Deffinitly just use Java then. After compiling it into a class, you can just create a shell script to execute 'java YourClassName' |
|
#9
|
|||
|
|||
|
Hi Eric,
thanks for your advice! i will try it out and post here again. thanks again.. really thanks btw, Merry Christmas~~~ HohOhohOho ![]() |
|
#10
|
|||
|
|||
|
A somewhat united alternative, maybe..
Druda
You might want to take a look at Borland's Delphi/Kylix solution. The Object Pascal used, with the CLX cross platform libraries allow fairly portable code between W32 and Linux, as long as you don't get too hairy with funky system calls (in either o/s). I haven't done any production type cross platform work here, you must understand, but just noodling around, my ports have been ok, not dead simple, but ok. I generally do the rough program methodology validation in W32, then the port. BTW, Kylix 3 comes with a C++ compiler, according to the last propaganda I got from Borland. Also, Borland has personal or open versions .... -hal |
![]() |
| Viewing: Dev Articles Community Forums > Programming > General Programming Help > HELP!!! Programmers Unite. |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|