Automatic conversion from PowerPoint to JPEG

Source: Internet
Author: User

Universal document converter works as a virtual printer and can save any document in the PDF, JPEG, Tiff, or PNG format. if you are a software developer, you can control the Settings Using com-interface and using Microsoft PowerPoint as com-server for converting your presentations to the JPEG format.

PowerPoint presentation conversion source code examples:

//////////////////////////////////////////////////////////////////// This example was designed to be used in Microsoft Visual C++ starting// from Microsoft Visual Studio 2003 or higher.//// 1. Microsoft PowerPoint 97 or higher should be installed and activated on your PC.//// 2. Universal Document Converter 5.2 or higher should be installed as well.//// 3. You should initialize the COM before calling any COM method.// Please insert ::CoInitialize(0); in your application initialization// and ::CoUninitialize(); before closing it.//// 4. Import Office libraries for 32-bit version of Windows.// For 64-bit version please change C:\\Program Files\\ to// C:\\Program Files (x86)\\ in all pathes.#pragma message("Import MSO.DLL")// MS Office 2000 ->// "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE10\\MSO.DLL"//// MS Office 2003 ->// "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE11\\MSO.DLL"//// MS Office 2007 -> // "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\MSO.DLL"#import "C:\\Program Files\\Common Files\\Microsoft Shared\\OFFICE12\\MSO.DLL" rename_namespace("MSO"), auto_rename#pragma message("Import VBE6EXT.OLB")#import "C:\\Program Files\\Common Files\\Microsoft Shared\\VBA\\VBA6\\VBE6EXT.OLB"     rename_namespace("VBE6EXT")#pragma message("Import MS Powerpoint API")// MS Office 2000 -> "C:\\Program Files\\Microsoft Office\\OFFICE\\MSPPT9.OLB"// MS Office 2003 -> "C:\\Program Files\\Microsoft Office\\OFFICE11\\MSPPT.OLB"// MS Office 2007 -> "C:\\Program Files\\Microsoft Office\\OFFICE12\\MSPPT.OLB"#import "C:\\Program Files\\Microsoft Office\\OFFICE12\\MSPPT.OLB"    rename_namespace("POWERPNT"), auto_rename// 5. Import Universal Document Converter software API:#import "progid:udc.apiwrapper" rename_namespace("UDC")//////////////////////////////////////////////////////////////////void PrintPowerPointToJPEG( CString sFilePath ){  UDC::IUDCPtr pUDC(__uuidof(UDC::APIWrapper));  UDC::IUDCPrinterPtr itfPrinter = pUDC->Printers["Universal Document Converter"];  UDC::IProfilePtr itfProfile = itfPrinter->Profile;// Use Universal Document Converter API to change settings of converterd document  itfProfile->PageSetup->Orientation = UDC::PO_LANDSCAPE;   itfProfile->FileFormat->ActualFormat = UDC::FMT_JPEG;  itfProfile->FileFormat->JPEG->ColorSpace = UDC::CS_TRUECOLOR;   itfProfile->OutputLocation->Mode = UDC::LM_PREDEFINED;  itfProfile->OutputLocation->FolderPath = L"C:\\Out";  itfProfile->OutputLocation->FileName = L"&[DocName(0)].&[ImageType]";  itfProfile->OutputLocation->OverwriteExistingFile = FALSE;  itfProfile->PostProcessing->Mode = UDC::PP_OPEN_FOLDER;// Run Microsoft Excel as COM-server  POWERPNT::_ApplicationPtr objPPTApp(L"PowerPoint.Application");  POWERPNT::_PresentationPtr itfPresentation;  POWERPNT::PrintOptionsPtr itfPrintOptions;// Open document from file  itfPresentation = objPPTApp->Presentations->Open( (LPCTSTR)sFilePath, MSO::msoTrue,  MSO::msoTrue, MSO::msoFalse );// Print all slides from the presentation  itfPrintOptions = itfPresentation->PrintOptions;  itfPrintOptions->put_PrintInBackground( MSO::msoFalse );  itfPrintOptions->ActivePrinter = "Universal Document Converter";  itfPresentation->PrintOut( 0, itfPresentation->Slides->Count, _T(""), 1,  MSO::msoFalse );// Close the presentation  itfPresentation->Close();// Close Microsoft PowerPoint  objPPTApp->Quit();}


Automatic conversion from PowerPoint to JPEG

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.