//---------------------------------------------------------------------------------------------------------------------------------------------------
// Last Change: 2025-07-01      Name: HelloWorld.cpp
//---------------------------------------------------------------------------------------------------------------------------------------------------

#include  "mki_lib6\mki_lib6.h"

//---------------------------------------------------------------------------------------------------------------------------------------------------
int WINAPI
WinMain( _In_ HINSTANCE f_hInstance, _In_opt_ HINSTANCE f_hPrevInstance, _In_ LPSTR f_pszCmdLine, _In_ int f_nShowCmd )
{
  // Start the engine
  MKI_ENGINE_DATA cData;
  cData.Init( L"Hello World" );
  cData.m_hAppIcon = LoadIcon( f_hInstance, L"APP_ICON" );
  if( MKI_EngineStart( cData ) )
  {
    // Clear out the drawing, no template data used
    MKI_DrawingInit( MKI_PAGETYPE_DIN_A4, false, false );

    // Create a text
    MKI_FONTDEF cFont;
    cFont.Init();
    if( MKI_XPROPERTY_PTR pXProperty = MKI_EntityText( L"Hello World!", 
                                                       105.0, 200.0, 20.0, 0.0, 1.1, 
                                                       MKI_TEXTMODE_CENTER, MKI_TEXTVERTICAL_LINETOP, cFont ) )
    {
      pXProperty->Init( MKI_FILLMODE_FILLED );
      pXProperty->SetFillColor( MKI_COLOR_CMYK_NEONRED, MKI_COLORMODE_CMYK100 );
    }

    // Create PDF file
    MKI_PRINT_DATA cPrintData;
    cPrintData.InitDirectPDF( L"D:\\Hello World.pdf", MKI_PAGETYPE_DIN_A4, true );

    MKI_DrawingPrint( &cPrintData, true );

    // Stop the engine
    MKI_EngineStop( false );
  }
  return( 0 );
}
