SOL9 Sample: PowerPointPublisher

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * PowerPointPublisher.cpp 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


//2010/05/12 
// This is a sample program to publish a PowerPoint file as a file of format of 'html', 'mhtml', 
// 'rtf', 'xps', 'pdf' or 'odp'.

//2012/05/11 Modified to use SOL::PowerPointPublisher class.

#include <sol/office/PowerPointPublisher.h>
#include <sol/Locale.h>

void _tmain(int argc, TCHAR** argv)
{
  if (! (argc == 3 || argc ==4)) {
    printf("Usage: PowerPointPublisher.exe docPathName html|mhtml|rtf|xps|pdf|odp.\n");
    printf("or:    PowerPointPublisher.exe docPathName savePathName html|mhtml|rtf|xps|pdf|odp.\n");
    printf("Note:  docPathName or savePathName can take a full or relative path.\n");

    return;
  }
  
  Locale locale;

  try {
    const TCHAR* docPathName = argv[1];
    const TCHAR* saveFormat = NULL;

    PowerPointPublisher publisher;

    if (argc == 3) {
      saveFormat = argv[2];
      publisher.publish(docPathName, saveFormat);
    }
    if (argc == 4) {
      const TCHAR* savePathName = argv[2];

      saveFormat = argv[3];
      publisher.publish(docPathName, savePathName, saveFormat);
    }

  } catch (HRESULT hr) {
    printf("Exception %x\n", hr);
  } catch (Exception& ex) {
    ex.printf();
  } catch (...) {
    printf("Unknown Exception \n");
  }
}


Last modified: 2 May 2016

Copyright (c) 2016 Antillia.com ALL RIGHTS RESERVED.