C++ API för att exportera EMAIL till PS

Förvandla EMAIL till PS i C++-applikationen utan att behöva Microsoft Word eller Outlook

 

Är du en C++-utvecklare som vill lägga till funktioner för e-postkonvertering i dina applikationer? Genom att använda Aspose.Email for C++ kan du konvertera EMAIL-filformat till HTML. Efter det, genom att använda Aspose.Words for C++ API, kan du exportera HTML till PS. Båda API:erna kommer under paketet Aspose.Total for C++ .

C++ API för att konvertera EMAIL till PS

  1. Öppna EMAIL-filen med MailMessage klassreferens
  2. Konvertera EMAIL till HTML genom att använda medlemsfunktionen Save
  3. Ladda HTML genom att använda klassen Document
  4. Spara dokumentet i PS-format med metoden Save och ställ in Ps som SaveFormat

Konverteringskrav

Installera från kommandoraden som nuget install Aspose.Total.Cpp eller via Package Manager Console of Visual Studio med Install-Package Aspose.Total.Cpp.

Alternativt kan du hämta offline MSI-installationsprogrammet eller DLL-filer i en ZIP-fil från downloads .

// load the EMAIL file to be converted
System::SharedPtr<MailMessage> msg = MailMessage::Load(u"sourceFile.msg");
// save EMAIL as a HTML 
msg->Save(u"HtmlOutput.html", SaveOptions::get_DefaultHtml());  
// load HTML with an instance of Document
System::SharedPtr<Document> doc = System::MakeObject<Document>(u"HtmlOutput.html");
// call save method while passing Ps as save format
doc->Save(u"convertedFile.Ps");

Analysera EMAIL-fil via C++

Du kan inte bara konvertera din EMAIL till PS, utan du kan läsa, manipulera och analysera EMAIL-dokument. Du kan få ämne, adress, text, mottagares information för e-postmeddelandet genom att använda MapiMessage-klassen av Aspose.Email for C++ API. Du kan till exempel söka efter en specifik avsändar-e-post för konverteringen genom att använda egenskapen get_SenderEmailAddress().

// create an instance of MapiMessage from file
System::SharedPtr<MapiMessage> msg = MapiMessage::FromFile(dataDir + L"message.msg");
// get subject
System::Console::WriteLine(System::String(L"Subject:") + msg->get_Subject());
// get from address
System::Console::WriteLine(System::String(L"From:") + msg->get_SenderEmailAddress());
// get body
System::Console::WriteLine(System::String(L"Body") + msg->get_Body());
// get recipients information
System::Console::WriteLine(System::String(L"Recipient: ") + msg->get_Recipients());

C++ API för att begränsa redigering av PS-filformat

Du kan också lägga till dokumentskyddsfunktioner i din app medan du exporterar dokumentet från EMAIL till PS. Att lägga till skydd till ditt dokument är en enkel process, eftersom allt du behöver göra är att tillämpa skyddsmetoden på ditt dokument. Du kan ställa in skyddstypen på Skrivskyddad för att begränsa användaren att redigera dokumentet.

// create a new document and protect it with a password.
auto doc = System::MakeObject<Document>();
// apply Document Protection.
doc->Protect(ProtectionType::ReadOnly, u"password");
// save the document.
doc->Save(u"DocumentProtection.PasswordProtection.Ps");

Utforska EMAIL konverteringsalternativ med C++

Konvertera MSGs till BMP (Bitmap Image File)
Konvertera MSGs till DOC (Microsoft Word Binary Format)
Konvertera MSGs till DOCM (Microsoft Word 2007 Marco File)
Konvertera MSGs till DOCX (Office 2007+ Word Document)
Konvertera MSGs till DOT (Microsoft Word Template Files)
Konvertera MSGs till DOTM (Microsoft Word 2007+ Template File)
Konvertera MSGs till DOTX (Microsoft Word Template File)
Konvertera MSGs till EMF (Enhanced Metafile Format)
Konvertera MSGs till EPUB (Open eBook File)
Konvertera MSGs till FLATOPC (Microsoft Word 2003 WordprocessingML)
Konvertera MSGs till GIF (Graphical Interchange Format)
Konvertera MSGs till PNG (Portable Network Graphic)
Konvertera MSGs till JPEG (Joint Photographic Expert Group)
Konvertera MSGs till MD (Markdown Language)
Konvertera MSGs till ODT (OpenDocument Text File Format)
Konvertera MSGs till OTT (OpenDocument Standard Format)
Konvertera MSGs till PCL (Printer Command Language Document)
Konvertera MSGs till PDF (Portable Document Format)
Konvertera MSGs till PNG (Portable Network Graphic)
Konvertera MSGs till PS (PostScript File)
Konvertera MSGs till RTF (Rich Text Format)
Konvertera MSGs till SVG (Scalar Vector Graphics)
Konvertera MSGs till TIFF (Tagged Image File Format)
Konvertera MSGs till DOCX (Office 2007+ Word Document)
Konvertera MSGs till WORDML (Microsoft Word 2003 WordprocessingML)
Konvertera MSGs till XPS (XML Paper Specifications)