error in printing a file

sumit sumit.surwase at patni.com
Tue Jun 7 04:02:12 PDT 2011


Hi Guys,
 I am new to cups n trying to learn it by executing simple programs.I am trying to print a ps file through code using cupsPrintFile..The code is as follows:
[code]

#include <cups/cups.h>
#include<stdio.h>
int main()
{
int num_dests;
cups_dest_t *dests, *default_dest;
int job_id;
num_dests = cupsGetDests(&dests);
default_dest = cupsGetDest(NULL, NULL, num_dests, dests);
job_id = cupsPrintFile(default_dest->name, "/data/print.ps","my title",default_dest->num_options,default_dest->options);
//printf("\n\n\\t%d",job_id);
return 0;
}





[\code]


Programs execute properly but didn't print the file .I checked error log file which is showing me following error.
[error]

E [15/Jun/2011:14:54:15 +0000] Unable to bind socket for address ::1:631 - Address already in use.
E [15/Jun/2011:14:54:15 +0000] Unable to bind socket for address 127.0.0.1:631 - Address already in use.
X [15/Jun/2011:14:54:15 +0000] No Listen or Port lines were found to allow access via localhost!
E [15/Jun/2011:15:14:17 +0000] [Job 71] Aborting job because it has no files.
E [15/Jun/2011:15:39:50 +0000] Unable to bind socket for address ::1:631 - Address already in use.
E [15/Jun/2011:15:39:50 +0000] Unable to bind socket for address 127.0.0.1:631 - Address already in use.
X [15/Jun/2011:15:39:50 +0000] No Listen or Port lines were found to allow access via localhost!
E [15/Jun/2011:15:39:59 +0000] Unable to bind socket for address ::1:631 - Address already in use.
E [15/Jun/2011:15:39:59 +0000] Unable to bind socket for address 127.0.0.1:631 - Address already in use.
X [15/Jun/2011:15:39:59 +0000] No Listen or Port lines were found to allow access via localhost!



[\error]



Can Anybody help me to solve this problem ?
Thanks
Regards,
Sumit

















More information about the cups mailing list