/*
//
//   ADOBE SYSTEMS INCORPORATED
//   Copyright (C) 2000-2003 Adobe Systems Incorporated
//   All rights reserved.
//
//   NOTICE: Adobe permits you to use, modify, and distribute this file
//   in accordance with the terms of the Adobe license agreement
//   accompanying it. If you have received this file from a source other
//   than Adobe, then your use, modification, or distribution of it
//   requires the prior written permission of Adobe.
//
*/

#if INCLUDE_MYPDFLIBAPP_CPP

#include "MyPDFLibUtils.h"

#ifndef MAC_PLATFORM
#include <stdlib.h>
#include <stdio.h>
#endif


/* The main starts here. */
int   main( int  argc,  char  *argv[],  char  *envp[])
{
                INIT_AUTO_POOL(autoReleasePool);                /* Required only on MAC platform */

                int  err =  MyPDFLInit();  /* initialize the PDFLib */
                if  (err != 0)                                      /* check for error after initialization */
               {
                               fprintf(stderr,  "Initialization error. See \"AcroErr.h\" for more info.\n" );
                               fprintf(stderr,  "Error system: %d\nError Severity: %d\nError Code: %d\n" ,
                                                                                                ErrGetSystem(err),  ErrGetSeverity(err),  ErrGetCode(err));
               }
                else
               {
                                MainProc();
                                MyPDFLTerm();      /* terminate the PDFLib */
               }

                RELEASE_AUTO_POOL(autoReleasePool);          /* Required only on MAC platform */
                return  0;
}

#endif  /* INCLUDE_MYPDFLIBAPP_CPP */