The LoadPDF Windows Management Instrumentation (WMI) class method, in Configuration Manager, imports a specified package definition file into the package definition file store.

The following syntax is simplified from Managed Object Format (MOF) code and defines the method.

SInt32 LoadPDF(
	 String PDFFileName,
	 String PDFFile,
	 UInt32 PDFID,
	 String RequiredIconNames[]



Data type: StringQualifiers: [in,SizeLimit("100")]Full path and file name of the package definition file. The SMS Provider copies the file to the \Smsinstalldir\Scripts\<localeid>\Pdfstore\<pdfid> directory and replaces the .pdf file name extension with an .sms file name extension.

Data type: StringQualifiers: [in]Text of the package definition file itself.

Data type: UInt32Qualifiers: [out]Assigned package definition file ID.

Data type: String ArrayQualifiers: [out]List of icons referenced by the package definition file that must be loaded separately through the LoadIconForPDF Method in Class SMS_PDF_Package method.

Return Values

An SInt32 data type that indicates 0 for success or one of the following bit field warning flags for failure.

Flag Description


Invalid run information specified.


Invalid restart information specified.


Invalid CanRunWhen information specified.


Invalid assignment information specified.


Invalid DependentProgram information specified.


Invalid SpecifyDrive information specified.


Invalid EstimatedDiskSpace information specified.


No SupportedClients information specified.


Invalid SupportedClients information specified.


Version 1.0 file used.


The remove program is set but no uninstall key is given.


When your application imports a package definition file that has the same Name, Publisher, Version, and Language properties as an existing package definition file, the existing package definition file is overwritten, including the file icons and programs. The value specified in the PDFID parameter is retained.

Example Code

The following example shows how to load a package definition file into the package definition file package store.

  Copy Code
	Const ForReading = 1
	Dim fs, f						 ' File system object and file object.
	Dim clsPDF As SWbemObject		 ' SMS_PDF_Package class definition.
	Dim ReturnCode As Long			' Return code value from LoadPDF method.
	Dim PDFID As Long				 ' Package definition file identifier generated from LoadPDF.
	Dim PDFContent As String		' Package definition file file content.
	Dim ReqIconNames() As Variant	 ' Required icon names from LoadPDF.
	Dim Icon() As Byte				' Icon used as input to LoadIconForPDF method.
	Dim i, j As Integer
	Dim FileSize As Integer		 ' Size of the icon file.

	Set Services = GetObject("winmgmts:\root\sms\<sitecode>")

	' Open the package definition file file and read the content into a string.
	Set fs = CreateObject("Scripting.FileSystemObject")
	Set f = fs.OpenTextFile(<path\filename>, ForReading)
	PDFContent = f.ReadAll

	' Load the package definition file into the package definition file store. Use the PDFID and ReqIconNames 
	' Variables in the LoadIconForPDF method.
	Set clsPDF = Services.Get("SMS_PDF_Package")
	ReturnCode = clsPDF.LoadPDF(<path\filename>, _
								PDFContent, _
								PDFID, _
	' You must load all the icons for the package definition file if the package definition file contains icons.
	For i = LBound(ReqIconNames) To UBound(ReqIconNames)
		Open <path> & ReqIconNames(i) For Binary Access Read As #1
		FileSize = LOF(1) - 1
		ReDim Icon(FileSize)
		For j = 0 To FileSize
			Get #1, , Icon(j)
		Close #1
		clsPDF.LoadIconForPDF PDFID, ReqIconNames(i), Icon


Runtime Requirements

Development Requirements

See Also