예제 #1
0
PAPERINFO * PRpaperinfoOriginal (PAPERCODE size, int xres, int yres)
{
	int i;
	PAPERINFO  *p, * papers;
        papers = (PAPERINFO*)malloc(115 * sizeof(PAPERINFO));
	i = PRpapertable(papers, xres, yres);

	for (p = papers; i > 0; i--, p++) {
		/*ASSERT(p);*/
		if (p->OMcode == size) {
#ifdef LONG_EDGE_FEED
		/*	For these four sizes, we have matched pairs of entries in the table,
		 *	with the short-edge version preceeding the long-edge version, such that
		 *	when we have the first one in 'p', the second is implicitly at 'p+1'.
		 *	The option that we are interrogating is normally implemented, for Core
		 *	testing, by the "-L" command-line switch; for porting/customer purposes,
		 *	this may have to be modified.  (A long-edge version of A3, for example,
		 *	is quite unlikely in a typical printer.)
		 *
		 *	Because this OM call will lock a semaphore, it is inadvisable to call
		 *	PRpaperinfo() before the Options Manager has been initialized.
		 *	If this proves to be a problem, Core can replace the option with
		 *	a simple global flag; customers might need something more elaborate.
		 */
			  if (p->OMcode == PAPERSIZE_A4 && OMGetCurrentBool(LONGEDGEFEED, OMPRINTER))
			    return (p + 1);
			   else if (p->OMcode == PAPERSIZE_LETTER && OMGetCurrentBool(LONGEDGEFEED, OMPRINTER))
			    return (p + 1);
#endif
			return p;
		}
	}
	return NULL;
return papers;
}
예제 #2
0
void PRcustompaperinfo(int pwidth, int plength, int xres, int yres)
{ 

    int i;
    Sint32 n;
    PAPERINFO * np = (PAPERINFO *) paper_table_variable_resolution;
    const PAPERINFO * op = (const PAPERINFO *) System_Paper_table;
    Boolean convert8 = ( xres % 300 );
#if defined(SUPPORT_EDGE2EDGE) || defined(RXPS_EDGE_TO_EDGE)
    Boolean edge2edge  = OMGetCurrentBool(OMEDGETOEDGE,OMSYSTEM);
#ifdef PCL_CUSTOM_EDGE2EDGE
    Boolean enter_lang;
    int NBITS=g_pstCurrentJob->uOutputBPP; /* temporarily*/
	if(customEdge2Edge){
		int njobid, ujobid;
    	enter_lang = OMGetCurrentEnum(OMREQPROCREASON, OMSYSTEM) ==
						GPS_PENV_VAL_INT_REQPROCREASON_ENTERLANGUAGE;
		PrintSysGetjobid(&njobid);
		/*PrintSysGetjobid( &njobid, &ujobid);
		if(njobid == pre_njobid && ujobid == pre_ujobid)
			enter_lang = pre_enter_lang_custom;
		else {
			pre_njobid = njobid;
			pre_ujobid = ujobid;
		}*/
	}
#endif /* PCL_CUSTOM_EDGE2EDGE */
#endif /* SUPPORT_EDGE2EDGE || RXPS_EDGE_TO_EDGE */

#if defined(SUPPORT_EDGE2EDGE) || defined(RXPS_EDGE_TO_EDGE)
    if (cvtx == xres && cvty == yres && cvtw == pwidth && cvtl == plength && set_edge2edge_custom == edge2edge
#ifdef PCL_CUSTOM_EDGE2EDGE
					 && (!customEdge2Edge || enter_lang == pre_enter_lang_custom) 
#endif
       )
        return;
#else
    if (cvtx == xres && cvty == yres && cvtw == pwidth && cvtl == plength)
        return;
#endif /* SUPPORT_EDGE2EDGE || RXPS_EDGE_TO_EDGE */

	for (i = MAX_TABLE_SIZE; i > 0; i--, np++, op++) {
        if (op->OMcode == PAPERSIZE_CUSTOM)
            break;
    }

    if (i == 0)
        return;

#if defined(SUPPORT_EDGE2EDGE) || defined(RXPS_EDGE_TO_EDGE)
    if ( edge2edge ) {
#ifdef PCL_CUSTOM_EDGE2EDGE
		if (customEdge2Edge && !enter_lang) {
			np->size.x = np->printable.x = np->rotnomsize.x = pwidth;
			/*np->nominal.x = pwidth - CONVERT_XONE(nomoffset);*/
			np->size.y = np->printable.y = np->nominal.y = plength;
			/*np->rotnomsize.y = plength - CONVERT_YONE(rotnomoffset);*/
			np->offset.x = np->offset.y = 0;
			/*CONVERT(nomoffset);
			if (pwidth >= plength) {
				CONVERT(rotnomoffset);
			} else {
				np->rotnomoffset.x = np->rotnomoffset.y = 0;
			}*/  /* commenting as the function CONVERT() not available*/
	
			/*	The next 2 entries are NOT scaled. They get scaled when they used.
			 */
			np->HPnomoffset.x = np->nomoffset.x;
			np->HPnomoffset.y = np->HProtnomoffset.x = 0;
			np->HProtnomoffset.y = np->rotnomoffset.y;
		} else {
#endif /*PCL_CUSTOM_EDGE2EDGE*/   

#ifdef RP_CUSTOMPAPERSIZE
#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))
	if ((current_pdlid == GPS_PDL_POSTSCRIPT) || (current_pdlid == GPS_PDL_PDF)){
#endif
    if(pwidth > plength){
        np->size.x = np->printable.x = np->nominal.x = np->rotnomsize.x = plength;
        np->size.y = np->printable.y = np->nominal.y = np->rotnomsize.y = pwidth;
    } else {
        np->size.x = np->printable.x = np->nominal.x = np->rotnomsize.x = pwidth;
        np->size.y = np->printable.y = np->nominal.y = np->rotnomsize.y = plength;
	}   
#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))
    } else {		
        np->size.x = np->printable.x = np->nominal.x = np->rotnomsize.x = pwidth;
        np->size.y = np->printable.y = np->nominal.y = np->rotnomsize.y = plength;
	}   
#endif
#else    /* RP_CUSTOMPAPERSIZE */ 
        np->size.x = np->printable.x = np->nominal.x = np->rotnomsize.x = pwidth;
        np->size.y = np->printable.y = np->nominal.y = np->rotnomsize.y = plength;
#endif  /* RP_CUSTOMPAPERSIZE */ 
        np->offset.x = np->nomoffset.x = np->rotnomoffset.x = 0;
        np->offset.y = np->nomoffset.y = np->rotnomoffset.y = 0;

		/*  The next 2 entries are NOT scaled. They get scaled when they used.
         */
        np->HPnomoffset.x = np->HProtnomoffset.x = 0;
        np->HPnomoffset.y = np->HProtnomoffset.y = 0;
#ifdef PCL_CUSTOM_EDGE2EDGE
		}
#endif

    } else {
#endif

#ifdef RP_CUSTOMPAPERSIZE
#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))
	if ((current_pdlid == GPS_PDL_POSTSCRIPT) || (current_pdlid == GPS_PDL_PDF)){
#endif
    /*np->printable.x = pwidth - 2 * CONVERT_XONE(offset);
    np->printable.y = plength - 2 * CONVERT_YONE(offset);*/
    if(pwidth > plength){
    np->size.x = plength;
    np->size.y = pwidth;
   /* np->nominal.x = plength - 2 * CONVERT_XONE(nomoffset);
    np->nominal.y = pwidth - 2 * CONVERT_YONE(nomoffset);
    np->rotnomsize.x = plength - 2 * CONVERT_XONE(rotnomoffset);
    np->rotnomsize.y = pwidth - 2 * CONVERT_YONE(rotnomoffset);*/
    } else {
    np->size.x = pwidth;
    np->size.y = plength;
    /*np->printable.x = pwidth - 2 * CONVERT_XONE(offset);
    np->printable.y = plength - 2 * CONVERT_YONE(offset);
    np->nominal.x = pwidth - 2 * CONVERT_XONE(nomoffset);
    np->nominal.y = plength - 2 * CONVERT_YONE(nomoffset);
    np->rotnomsize.x = pwidth - 2 * CONVERT_XONE(rotnomoffset);
    np->rotnomsize.y = plength - 2 * CONVERT_YONE(rotnomoffset);*/
    }
#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))
    } else{
    np->size.x = pwidth;
    np->size.y = plength;
    /*np->printable.x = pwidth - 2 * CONVERT_XONE(offset);
    np->printable.y = plength - 2 * CONVERT_YONE(offset);
    np->nominal.x = pwidth - 2 * CONVERT_XONE(nomoffset);
    np->nominal.y = plength - 2 * CONVERT_YONE(nomoffset);
    np->rotnomsize.x = pwidth - 2 * CONVERT_XONE(rotnomoffset);
    np->rotnomsize.y = plength - 2 * CONVERT_YONE(rotnomoffset);*/
	}
#endif
#else   /* RP_CUSTOMPAPERSIZE */ 
	
    np->size.x = pwidth;
    np->size.y = plength;
  /*  np->printable.x = pwidth - 2 * CONVERT_XONE(offset);
    np->printable.y = plength - 2 * CONVERT_YONE(offset);
    np->nominal.x = pwidth - 2 * CONVERT_XONE(nomoffset);
    np->nominal.y = plength - 2 * CONVERT_YONE(nomoffset);
    np->rotnomsize.x = pwidth - 2 * CONVERT_XONE(rotnomoffset);
    np->rotnomsize.y = plength - 2 * CONVERT_YONE(rotnomoffset);*/
#endif /* RP_CUSTOMPAPERSIZE */ 

    /*
    CONVERT(offset);
    CONVERT(nomoffset);
    CONVERT(rotnomoffset);*/ /* commenting as the function CONVERT() not available*/
    
    /*  The next 2 entries are NOT scaled. They get scaled when they used.
     */
    /*FIELDCOPY(HPnomoffset);
    FIELDCOPY(HProtnomoffset);*/ /* commenting as the function FIELDCOPY() not available*/

#if defined(SUPPORT_EDGE2EDGE) || defined(RXPS_EDGE_TO_EDGE)
    }
#endif

#ifdef PCL5_CUSTOMSIZE_COMMAND
#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))
	if ((current_pdlid == GPS_PDL_PCL) || (current_pdlid == GPS_PDL_PCLXL)){
#endif
    if (np->printable.x <= 0)
        np->printable.x = NBITS;
    if (np->nominal.x <= 0)
        np->nominal.x = NBITS;
    if (np->rotnomsize.x <= 0)
        np->rotnomsize.x = NBITS;
    if (np->printable.y <= 0)
        np->printable.y = 1;
    if (np->nominal.y <= 0)
        np->nominal.y = 1;
    if (np->rotnomsize.y <= 0)
        np->rotnomsize.y = 1;
#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))
	}
#endif
#endif /* PCL5_CUSTOMSIZE_COMMAND */

    np->OMcode = op->OMcode;
    np->PCLpaperID = op->PCLpaperID;
    np->XLpaperID = op->XLpaperID;
    np->envelope = op->envelope;
    np->noduplex = op->noduplex;

#ifdef EMPOSTSCRIPT /* RP_CUSTOMPAPERSIZE */
#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))
	if ((current_pdlid == GPS_PDL_POSTSCRIPT) || (current_pdlid == GPS_PDL_PDF)){
#endif
#ifdef RP_CUSTOMPAPERSIZE
      if(pwidth > plength){
	np->PS_PageSize.x = (int)(((float)plength/xres)*72);  /* dot -> pt */
	np->PS_PageSize.y = (int)(((float)pwidth/yres)*72); /* dot -> pt */
      	}else{
	np->PS_PageSize.x = (int)(((float)pwidth/xres)*72);  /* dot -> pt */
	np->PS_PageSize.y = (int)(((float)plength/yres)*72); /* dot -> pt */
	  	}
#endif /* RP_CUSTOMPAPERSIZE */ 
#if defined(SUPPORT_EDGE2EDGE) || defined(RXPS_EDGE_TO_EDGE)
    if ( edge2edge ) {
		np->PS_printable.x = pwidth;
		np->PS_printable.y = plength;
		np->PS_margins.x = 0;
		np->PS_margins.y = 0;
    } else {
#endif /* SUPPORT_EDGE2EDGE || RXPS_EDGE_TO_EDGE */
		/*np->PS_printable.x = pwidth - 2 * CONVERT_XONE(PS_margins);
		np->PS_printable.y = plength - 2 * CONVERT_YONE(PS_margins);
		CONVERT(PS_margins);*/
#if defined(SUPPORT_EDGE2EDGE) || defined(RXPS_EDGE_TO_EDGE)
    }
#endif
#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))
	}
#endif
#endif /* EMPOSTSCRIPT (RP_CUSTOMPAPERSIZE) */

    np->resolution.x = xres;
    np->resolution.y = yres;

#ifdef GPS_REJECTION
	np->Direction = op->Direction;
	np->Duplex = op->Duplex;
	np->Staple = op->Staple;
	np->RotateCollate = op->RotateCollate;
	np->StandardTray = op->StandardTray;
	np->ShiftBin = op->ShiftBin;
	np->MailBoxBin = op->MailBoxBin;
#endif /* GPS_REJECTION */

    cvtx = xres;
    cvty = yres;
    cvtw = pwidth;
    cvtl = plength;
#if defined(SUPPORT_EDGE2EDGE) || defined(RXPS_EDGE_TO_EDGE)
    set_edge2edge_custom = edge2edge;
#ifdef PCL_CUSTOM_EDGE2EDGE
	if(customEdge2Edge){
		pre_enter_lang_custom = enter_lang;
	}
#endif
#endif /* SUPPORT_EDGE2EDGE || RXPS_EDGE_TO_EDGE */

}
예제 #3
0
/*#ifdef COMMON_PLATFORM
#if (defined(EMPCL5)||defined(EMPCLXL)) || (defined(EMPOSTSCRIPT)||defined(EMPDF))*/
int PrintSysPaperRequest( Sint32 *psize, Sint32 pwidth, Sint32 plength,
							OMenum ptype, Sint32 tray, Boolean direction)
{
#if 0
    int ret, i;
	Sint32	lsize, ssize;
#ifdef	ROTATE_FORCE_PRINT
	Sint32	newpsize;
#endif	
#if defined(EMPOSTSCRIPT)||defined(EMPDF)
 	di_res_reqtray_t response;
#else
 	di_res_reqpaper_t response;
#endif/*defined(EMPOSTSCRIPT)||defined(EMPDF)*/
	di_onetrayinfo_t * pTray;
	di_trayinfo_t trayinfo;
	/*TimeVal tmwait = { 0, 200000 };*/
	Sint32	sec_size;	/* second selection if psize is unsupported by the printer */

#if defined(EMPOSTSCRIPT)||defined(EMPDF)
	int res = 0;
	di_trayrequest_t trayreq;  	
	trayreq.flag = DI_TRAYREQFLAG_ALL;
	trayreq.pwidth = pwidth;
	trayreq.plength = plength;
	trayreq.mode = DI_REQ_MODE1;
#endif/*defined(EMPOSTSCRIPT)||defined(EMPDF)*/
	
	if (plotterID == -1)
#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))
	if (PrintSysIsInterpPS()) {
		PRJobStart(pPDIstatePS, g_prh, -1);
	}else{
		PRJobStart(pPDIstatePCL, g_prh, -1);
	}
#elif defined(EMPCL5) || defined(EMPCLXL)
		PRJobStart(pPDIstatePCL, g_prh, -1);
#elif (defined(EMPOSTSCRIPT)||defined(EMPDF))
		PRJobStart(pPDIstatePS, g_prh, -1);
#endif /*(defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))*/

#ifdef EN_LIMITLESS_FEED
	if (OMGetCurrentBool(OMAUTOTRAYCHANGE2, OMSYSTEM) || (OMGetCurrentEnum(OMTRAYSEARCHMODE, OMSYSTEM) == TRAYSEARCHMODE_SWITCH)){
		tray = PAPERSRC_ALL;
  }
#else
if (!PrintSysIsInterpPS()) {
	if (OMGetCurrentEnum(OMTRAYSEARCHMODE, OMSYSTEM) == TRAYSEARCHMODE_SWITCH)
		tray = PAPERSRC_ALL;
}
#endif

#if defined(EMPOSTSCRIPT)||defined(EMPDF)
 	init_ReqTrayResponseStatus();
#endif/*defined(EMPOSTSCRIPT)||defined(EMPDF)*/
 
   	while (1) {
 /*		
#if defined(EMPOSTSCRIPT)||defined(EMPDF)
 		ret = DI_request_tray ( plotterID, mnOMtoHdwPaperSize(*psize), direction ? 0 : 1,
 						mnOMtoHdwMediaType(ptype), mnOMtoHdwPaperSource(tray),&trayreq, &res) ;
 	
 		if ( res  !=  -1) { 	/* -1: FAILURE, but can retry */
 /*      		break;
     	}
#else
 		ret = DI_request_paper(plotterID, mnOMtoHdwPaperSize(*psize), direction ? 0 : 1,
 						mnOMtoHdwMediaType(ptype), mnOMtoHdwPaperSource(tray),&response);
 		if (ret != -2){	/* !PAGE_BUSY *
       		break;
     	}
#endif *defined(EMPOSTSCRIPT)||defined(EMPDF)*
     	else if (PrintSysGetJobCancel()) {			
 			response.result = DI_TRAY_CANCEL;		
  			break;
     	}
  
  		TaskSleep(&tmwait);*/
   	}
 

/*	LOGMPRINTF6(0x309, "[%s]0309 %d, %d, %d, %d, %d\n", PDLNAME, *psize, pwidth, plength, ptype, direction);
*/
	ASSERT( ret != -1 );	/* !PAGE_FAILURE */

#if defined(EMPOSTSCRIPT)||defined(EMPDF)
 	while (1) {
 			
 		if (PrintSysGetJobCancel()) {			
 			response.result = DI_TRAY_CANCEL;		
 			break;
     		}
 		else if ( TRUE == GetReqTrayResponseStatus() )
 		{
 			response = GetRequestTrayRes();
 			break;
 		}
 		
 		TaskSleep(&tmwait);	
 	}	
#endif/*defined(EMPOSTSCRIPT)||defined(EMPDF)*/
 
	switch (response.result) {
	case DI_TRAY_FOUND:
#ifdef DI_TRAY_ANOTHER
	case DI_TRAY_ANOTHER:
#endif
#ifndef IPS_MEDIA_HANDLING
/*#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))*/
		if (PrintSysIsInterpPS()) {
				return (1);
		} else {
	/*  *psize = mnHdwPaperSizetoOM(response.paper_code);*/
		break;
		}
/*#elif (defined(EMPCL5)||defined(EMPCLXL))*/
/*		*psize = mnHdwPaperSizetoOM(response.paper_code);*/
		break;
/*#else*/
		return (1);
/*#endif *//* (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF) */
#else /* IPS_MEDIA_HANDLING */
	/*		*psize = mnHdwPaperSizetoOM(response.paper_code);*/
			break;
#endif /* IPS_MEDIA_HANDLING */

	case DI_TRAY_ERRSKIP:
#ifndef IPS_MEDIA_HANDLING
/*#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))*/
				if (PrintSysIsInterpPS()) {
					return (1);
				} else {
		DI_get_trayinfo(&trayinfo);

/*		for (i = 0; i < trayinfo.tray_num; i++) {
			pTray = &trayinfo.trayinfo[i];

			if (pTray->id == response.tray_id) {
				if (pTray->p_size < DI_CODE_T) {
					if (response.paper_code < DI_CODE_T)
					{
						*psize = mnHdwPaperSizetoOM(response.paper_code);
						sec_size = mnHdwPaperSizetoOM(response.paper_code + DI_CODE_T);
					}
					else
					{
						*psize = mnHdwPaperSizetoOM(response.paper_code -
													DI_CODE_T);
						sec_size = mnHdwPaperSizetoOM(response.paper_code);
					}
				} else {
					if (response.paper_code < DI_CODE_T)
					{
						*psize = mnHdwPaperSizetoOM(response.paper_code +
													DI_CODE_T);
						sec_size = mnHdwPaperSizetoOM(response.paper_code);
					}
					else
					{
						*psize = mnHdwPaperSizetoOM(response.paper_code);
						sec_size = mnHdwPaperSizetoOM(response.paper_code - DI_CODE_T);
					}
				}
				if (!(PrintSysGetPaperInfo(*psize)) && PrintSysGetPaperInfo(sec_size))
					*psize = sec_size;
				break;
			}
		} */
		return(1);
				}
/*#elif (defined(EMPCL5)||defined(EMPCLXL))*/
		DI_get_trayinfo(&trayinfo);

	/*	for (i = 0; i < trayinfo.tray_num; i++) {
			pTray = &trayinfo.trayinfo[i];

			if (pTray->id == response.tray_id) {
				if (pTray->p_size < DI_CODE_T) {
					if (response.paper_code < DI_CODE_T)
					{
						*psize = mnHdwPaperSizetoOM(response.paper_code);
						sec_size = mnHdwPaperSizetoOM(response.paper_code + DI_CODE_T);
					}
					else
					{
						*psize = mnHdwPaperSizetoOM(response.paper_code -
													DI_CODE_T);
						sec_size = mnHdwPaperSizetoOM(response.paper_code);
					}
				} else {
					if (response.paper_code < DI_CODE_T)
					{
						*psize = mnHdwPaperSizetoOM(response.paper_code +
													DI_CODE_T);
						sec_size = mnHdwPaperSizetoOM(response.paper_code);
					}
					else
					{
						*psize = mnHdwPaperSizetoOM(response.paper_code);
						sec_size = mnHdwPaperSizetoOM(response.paper_code - DI_CODE_T);
					}
				}
				if (!(PrintSysGetPaperInfo(*psize)) && PrintSysGetPaperInfo(sec_size))
					*psize = sec_size;
				break;
			}
		} */
		return (1);
/*#else*/
		return (1);
/*#endif *//* (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF) */
#else /* IPS_MEDIA_HANDLING */
					DI_get_trayinfo(&trayinfo);

	/*				for (i = 0; i < trayinfo.tray_num; i++) {
						pTray = &trayinfo.trayinfo[i];

						if (pTray->id == response.tray_id) {
							if (pTray->p_size < DI_CODE_T) {
								if (response.paper_code < DI_CODE_T)
								{
									*psize = mnHdwPaperSizetoOM(response.paper_code);
									sec_size = mnHdwPaperSizetoOM(response.paper_code + DI_CODE_T);
								}
								else
								{
									*psize = mnHdwPaperSizetoOM(response.paper_code -
																DI_CODE_T);
									sec_size = mnHdwPaperSizetoOM(response.paper_code);
								}
							} else {
								if (response.paper_code < DI_CODE_T)
								{
									*psize = mnHdwPaperSizetoOM(response.paper_code +
																DI_CODE_T);
									sec_size = mnHdwPaperSizetoOM(response.paper_code);
								}
								else
								{
									*psize = mnHdwPaperSizetoOM(response.paper_code);
									sec_size = mnHdwPaperSizetoOM(response.paper_code - DI_CODE_T);
								}
							}
							if (!(PrintSysGetPaperInfo(*psize)) && PrintSysGetPaperInfo(sec_size))
								*psize = sec_size;
							break;
						}
					} */
				return (1);
#endif /* IPS_MEDIA_HANDLING */

	case DI_TRAY_FORCE:
#ifndef IPS_MEDIA_HANDLING
/*#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))*/
				if (PrintSysIsInterpPS()) {
					return (1);
				} else {
		DI_get_trayinfo(&trayinfo);

	/*	for (i = 0; i < trayinfo.tray_num; i++) {
			pTray = &trayinfo.trayinfo[i];

			if (pTray->id == response.tray_id) {
				if (pTray->p_size < DI_CODE_T) {
					ssize = mnHdwPaperSizetoOM(pTray->p_size);
					lsize = mnHdwPaperSizetoOM(pTray->p_size + DI_CODE_T);
				} else {
					lsize = mnHdwPaperSizetoOM(pTray->p_size);
					ssize = mnHdwPaperSizetoOM(pTray->p_size - DI_CODE_T);
				}

				if (ssize == *psize || lsize == *psize) {
					*psize = mnHdwPaperSizetoOM(pTray->p_size);
					PrintSysSetCompulsionPaperSize(*psize);
					PrintSysSetCompulsionInTray(
						mnHdwPaperSourcetoOM(response.tray_id));
					break;
				} else {
#ifdef	ROTATE_FORCE_PRINT
					newpsize = mnOMtoHdwPaperSize(*psize);

					if (pTray->p_size < DI_CODE_T) {
						newpsize = newpsize < DI_CODE_T ?
							newpsize : newpsize - DI_CODE_T;
					} else {
						newpsize = newpsize < DI_CODE_T ?
							newpsize + DI_CODE_T : newpsize;
					}

					*psize = mnHdwPaperSizetoOM(newpsize);
#endif
					PrintSysSetCompulsionPaperSize(
						mnHdwPaperSizetoOM(pTray->p_size));
					PrintSysSetCompulsionInTray(
						mnHdwPaperSourcetoOM(response.tray_id));
					return(1);
				}
			}
		} */ 
		return(1);
		break;
				}
/*#elif (defined(EMPCL5)||defined(EMPCLXL))*/
		DI_get_trayinfo(&trayinfo);

	/*	for (i = 0; i < trayinfo.tray_num; i++) {
			pTray = &trayinfo.trayinfo[i];

			if (pTray->id == response.tray_id) {
				if (pTray->p_size < DI_CODE_T) {
					ssize = mnHdwPaperSizetoOM(pTray->p_size);
					lsize = mnHdwPaperSizetoOM(pTray->p_size + DI_CODE_T);
				} else {
					lsize = mnHdwPaperSizetoOM(pTray->p_size);
					ssize = mnHdwPaperSizetoOM(pTray->p_size - DI_CODE_T);
				}

				if (ssize == *psize || lsize == *psize) {
					*psize = mnHdwPaperSizetoOM(pTray->p_size);
					PrintSysSetCompulsionPaperSize(*psize);
					PrintSysSetCompulsionInTray(
						mnHdwPaperSourcetoOM(response.tray_id));
					break;
				} else {
#ifdef	ROTATE_FORCE_PRINT
					newpsize = mnOMtoHdwPaperSize(*psize);

					if (pTray->p_size < DI_CODE_T) {
						newpsize = newpsize < DI_CODE_T ?
							newpsize : newpsize - DI_CODE_T;
					} else {
						newpsize = newpsize < DI_CODE_T ?
							newpsize + DI_CODE_T : newpsize;
					}

					*psize = mnHdwPaperSizetoOM(newpsize);
#endif
					PrintSysSetCompulsionPaperSize(
						mnHdwPaperSizetoOM(pTray->p_size));
					PrintSysSetCompulsionInTray(
						mnHdwPaperSourcetoOM(response.tray_id));
					return(1);
				}
			}
		}*/
		return(1);
		break;
/*#else*/
		return (1);
/*#endif*/ /* (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF) */
#else /* IPS_MEDIA_HANDLING */
					DI_get_trayinfo(&trayinfo);

				/*	for (i = 0; i < trayinfo.tray_num; i++) {
						pTray = &trayinfo.trayinfo[i];

						if (pTray->id == response.tray_id) {
							if (pTray->p_size < DI_CODE_T) {
								ssize = mnHdwPaperSizetoOM(pTray->p_size);
								lsize = mnHdwPaperSizetoOM(pTray->p_size + DI_CODE_T);
							} else {
								lsize = mnHdwPaperSizetoOM(pTray->p_size);
								ssize = mnHdwPaperSizetoOM(pTray->p_size - DI_CODE_T);
							}

							if (ssize == *psize || lsize == *psize) {
								*psize = mnHdwPaperSizetoOM(pTray->p_size);
								PrintSysSetCompulsionPaperSize(*psize);
								PrintSysSetCompulsionInTray(
									mnHdwPaperSourcetoOM(response.tray_id));
								break;
							} else {
#ifdef	ROTATE_FORCE_PRINT
								newpsize = mnOMtoHdwPaperSize(*psize);

								if (pTray->p_size < DI_CODE_T) {
									newpsize = newpsize < DI_CODE_T ?
										newpsize : newpsize - DI_CODE_T;
								} else {
									newpsize = newpsize < DI_CODE_T ?
										newpsize + DI_CODE_T : newpsize;
								}

								*psize = mnHdwPaperSizetoOM(newpsize);
#endif
								PrintSysSetCompulsionPaperSize(
									mnHdwPaperSizetoOM(pTray->p_size));
								PrintSysSetCompulsionInTray(
									mnHdwPaperSourcetoOM(response.tray_id));
								return(1);
							}
						}
					}*/ return(1);
					break;
#endif /* IPS_MEDIA_HANDLING */

	case DI_TRAY_CANCEL:
/*#ifndef IPS_MEDIA_HANDLING
#if (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF))*/
		if (PrintSysIsInterpPS()) {
			return (PANEL_JOB_CANCEL);
		} else {
		PrintSysSetJobCancel( TRUE );
#ifdef PRINTSYS_GJ_DEPEND
		jobCancelFlag |= JOB_CANCEL_FROM_SYSTEM;
#endif
		return(1);
		}
/*#elif (defined(EMPCL5)||defined(EMPCLXL))*/
		PrintSysSetJobCancel( TRUE );
		return(1);
/*#elif (defined(EMPOSTSCRIPT)||defined(EMPDF))
		return (PANEL_JOB_CANCEL);*/
/*#endif*/ /* (defined(EMPCL5)||defined(EMPCLXL)) && (defined(EMPOSTSCRIPT)||defined(EMPDF) */
/*#else*/ /* IPS_MEDIA_HANDLING */
			PrintSysSetJobCancel( TRUE );
			return(1);
/*#endif*/ /* IPS_MEDIA_HANDLING */
	}
	/* LOGMPRINTF5(0x310, "[%s]0310 %d, %d, %d, %d\n", PDLNAME, response.result, response.paper_code, response.tray_id, *psize); */
#endif  /* endof #if 0 */
	return(0);
}