SOL9 Sample: PowerPointPublisher

SOL9 2.0 Samples

1 Screenshot



Antillia.pptx file


Antillia.pptx.pdf file published by PowerPointPublisher from Antillia.pptx


2 Source code

/*
 * PowerPointPublisher.cpp 
 * Copyright (c) 2012 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: 16 May 2012

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