PDF.EXE

Overview

PDF.EXE is a console application that processes a PDF file and creates a package in the SMS site server database. The main purpose of this program is to provide a working sample to developers who may want to process PDFs and load them into SMS from their own applications. This code demonstrates datasource connection, folder creation, scalar and token manipulation, folder display, SMS API version identification, and helper functions.

Running the Program

PDF.EXE runs as a console application. To run the program, you can type either PDF or PDF filename.PDF. The program prompts you to enter the information needed to connect to the SQL server and then prompts you to enter the name of the PDF file if you did not specify one on the command line. Specify the file name with the .PDF extension. At this point, the program may prompt you for a directory as follows:

In either case, if you do not enter a directory at the prompt, the package will not be completely set up in SMS.

Functions

SmsAPIVer
SmsDataSourceConnect
SmsDataSourceDisconnect
SmsOpenContainer
SmsCloseContainer
SmsCreateFolder
SmsLinkFolder
SmsCommitFolder
SmsSetScalar
SmsGetNextScalar
SmsGetScalarCount
SmsCloseFolder
SmsCreateFolder
SmsManipulateTokens
SmsAddToken
SmsGetTokenCount
SmsGetToken
SmsGetFolderID
SmsGetFolderType
SmsGetFolderCount
SmsGetNextFolder
SmsCloseFolder
SmsRewind
SmsGetNextFolder

Program Flow

After logging on to a datasource and obtaining any missing information from the user, the program creates the package and displays package details in the console.