#include "ltdic.h"

L_LTDIC_API L_INT L_DicomPrintSCUCreatePullPrintRequest(hPrintSCU, InstancesInfo, uInstancesCount, pParameters)

HDICOMPRINTSCU hPrintSCU; A handle to Dicom Print SCU.
const pSTOREDPRINTSTORAGEINSTANCEINFO InstancesInfo; Referenced Stored Print.
L_UINT32 uInstancesCount; Count of Stored Print Instances.
const pPULLPRINTREQUESTPARAMETERS pParameters; Pull Print Request parameters.

Parameter Description
hPrintSCU A handle to Dicom Print SCU.
InstancesInfo Referenced Stored Print.
uInstancesCount Count of Stored Print Instances.
pParameters Pull Print Request parameters.


SUCCESS The function was successful.
< 1 An error occurred. Refer to Return Codes.


Only one Pull Print Request SOP Instance can be supported on the Association at any time.

The function will not return until it receives the response of the Print SCP, or an error occurs. The function L_DicomPrintSCUGetLastOperationStatus can be used to obtain the status code specified in the response of the Print SCP. When the return value of the function CreatePullPrintRequest is 0, then the Pull Print Request SOP Instance was created successfully, with either a Success or Warning status code in the response of the Print SCP.

Having the Instance created, the function L_DicomPrintSCUGetPullPrintRequestInstanceUID can then be used to obtain its SOP Instance UID. Also, the functions L_DicomPrintSCUPrintPullPrintRequestSession and L_DicomPrintSCUDeletePullPrintRequest can be used to print the session and to delete the Instance, respectively.

At least one Stored Print Storage SOP Instance must be specified to be referenced. The information about each such Instance is specified using a STOREDPRINTSTORAGEINSTANCEINFO structure. Except for the member pszPatientID, if any string member of the structure is set to NULL or if the member specifies an empty string, the function will return an error.

The parameter pParameters points to a PULLPRINTREQUESTPARAMETERS structure that specifies the parameters to be used when creating the Pull Print Request SOP Instance. In this structure, if a string member is NULL, then the corresponding Attribute will not be included in the request to the Print SCP. Similarly, if a numeric member (that specifies an Attribute) is negative, the corresponding Attribute will not be included in the request. If pParameters is set to NULL, then the request will be sent without specifying any parameters.

Required DLLs and Libraries

For a listing of the exact DLLs and Libraries needed, based on the toolkit version, refer to Files To Be Included With Your Application.


Win32, x64, Linux.

See Also

Functions: L_DicomPrintSCUGetPullPrintRequestInstanceUID, L_DicomPrintSCUPrintPullPrintRequestSession, L_DicomPrintSCUDeletePullPrintRequest, L_DicomPrintSCUGetDefaultPullPrintRequestParameters, L_DicomPrintSCUGetLastOperationStatus, L_DicomPrintSCUCreateFilmSession
Topics: Print Management SCU


L_INT DicomPrintSCUCreatePullPrintRequestExample() 
   L_INT          nRet; 
   hPrintSCU = L_DicomPrintSCUCreate(NULL); 
   L_TCHAR szMsg[32];  
   // Establish the Association 
   nRet = L_DicomPrintSCUAssociate (hPrintSCU, TEXT(""), 7104, TEXT("PrintSCP"), 2704, 
                              TEXT("PrintSCP"), TEXT("PrintSCU"), 
                              PRINTSCU_PULL_STORED_PM_META_SOP_CLASS | 
                              PRINTSCU_PRINT_JOB_SOP_CLASS | 
      L_UCHAR nSource, nReason;  
      L_DicomPrintSCUGetAssociateRejectInfo (hPrintSCU,NULL, &nSource, &nReason);  
      wsprintf(szMsg, TEXT("Source = %i, Reason = %i"), nSource, nReason);  
      MessageBox(NULL, szMsg, TEXT("Association Request was Rejected"), MB_OK);  
      return nRet;  
   else if (nRet != DICOM_SUCCESS)  
      wsprintf(szMsg, TEXT("Error code: %i"), nRet);  
      MessageBox(NULL, szMsg, TEXT("Failed to Establish the Association"), MB_OK);  
      return nRet; 
   // Display some printer info 
   // Display some printer configuration info 
   // A referenced Stored Print Storage SOP Instance 
   InstanceInfo.uStructSize = sizeof(STOREDPRINTSTORAGEINSTANCEINFO);  
   InstanceInfo.pszRetrieveAETitle = TEXT("SomeAE"); 
   InstanceInfo.pszReferencedSOPInstanceUID = TEXT("1.2.840.114257.254.7638.6787"); 
   InstanceInfo.pszStudyInstanceUID = TEXT("1.2.840.114257.945.5676.5674"); 
   InstanceInfo.pszSeriesInstanceUID = TEXT("1.2.840.114257.23.2343.3489"); 
   InstanceInfo.pszPatientID = TEXT("SomeID"); 
   // Ask the Print SCP to create a Pull Print Request SOP Instance 
   nRet = L_DicomPrintSCUGetDefaultPullPrintRequestParameters (hPrintSCU, &PullPrintReqParams,  
   if(nRet != DICOM_SUCCESS) 
      return nRet; 
   PullPrintReqParams.nNumberOfCopies = 1;  
   nRet = L_DicomPrintSCUCreatePullPrintRequest (hPrintSCU, &InstanceInfo, 1, &PullPrintReqParams);  
   if(nRet != DICOM_SUCCESS) 
      return nRet; 
   MessageBox(NULL, L_DicomPrintSCUGetPullPrintRequestInstanceUID (hPrintSCU), 
              TEXT("Pull Print Request SOP Instance UID"), MB_OK);  
   // Print the session 
   nRet = L_DicomPrintSCUPrintPullPrintRequestSession (hPrintSCU); 
   if(nRet != DICOM_SUCCESS) 
      return nRet; 
   // Display some info about the Print Job 
   if (L_DicomPrintSCUIsClassSupported (hPrintSCU, PRINTSCU_PRINT_JOB_SOP_CLASS))  
      //GetPrintJobInfo(PrintSCU, L_DicomPrintSCUGetPrintJobInstanceUID ()); 
   // Ask the Print SCP to delete the Pull Print Request SOP Instance 
   nRet = L_DicomPrintSCUDeletePullPrintRequest (hPrintSCU); 
   if(nRet != DICOM_SUCCESS) 
      return nRet; 
   // Release the Association and close the connection 
   nRet = L_DicomPrintSCURelease (hPrintSCU); 
   if(nRet != DICOM_SUCCESS) 
      return nRet; 
   return DICOM_SUCCESS; 
Help Version 20.0.2019.3.12
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.