C++ API för att exportera MHTML till DOT

Återge MHTML till DOT inom C++-applikationer utan att kräva någon tredjepartsapplikation

 

Aspose.Total for C++ filformatsautomatiseringsbibliotek tillåter C++-utvecklare att konvertera MHTML till DOT i två enkla steg. För det första kan du använda Aspose.PDF for C++ API för att konvertera MHTML-filformat till DOC. För det andra, genom att använda avancerad Word Document Processing API Aspose.Words for C++ , kan du exportera DOC till DOT.

C++ API för att rendera MHTML till DOT

  1. Öppna MHTML-filen med klassreferens Document
  2. Konvertera MHTML till DOC genom att använda medlemsfunktionen Save
  3. Ladda DOC-filen med hjälp av Document klassreferens för Aspose.Words API
  4. Spara dokumentet i DOT-format med hjälp av medlemsfunktionen Save

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 MHTML file with an instance of Document class reference
auto doc = MakeObject<Document>(u"sourceFile.mhtml");
// save MHTML as a DOC 
doc->Save(u"DocOutput.doc", SaveFormat::Doc); 
// load DOC with an instance of Document
System::SharedPtr<Document> wordDoc = System::MakeObject<Document>(u"DocOutput.doc");
// save document as Dot
wordDoc->Save(u"output.Dot");  

Ändra lösenord för MHTML-dokument via C++

I processen att rendera MHTML till DOT kan du öppna en lösenordsskyddad MHTML och även ändra dess lösenord. För att ändra lösenordet för en MHTML-fil måste du känna till ägarlösenordet för det dokumentet. Du kan ladda lösenordsskyddade PDF-dokument med Aspose.PDF for C++ genom att ange dess ägarlösenord och använda ChangePasswords-metoden för att ändra lösenordet.

// load an existing MHTML Document
auto doc = MakeObject<Document>(L"input.mhtml", L"owner");
// change password of MHTML Document
doc->ChangePasswords(L"owner", L"newuser", L"newuser");
// save the document
doc->Save(L"output.Doc");

Begränsa DOT-filredigering via C++

Du kan också begränsa redigering av DOT-filer genom att använda Aspose.Words for C++ API. Ibland kan du behöva begränsa möjligheten att redigera ett dokument och endast tillåta vissa åtgärder med det. API låter dig styra hur du begränsar innehållet med hjälp av uppräkningsparametern ProtectionType . Följande kodexempel visar hur man begränsar redigering i ett dokument så att endast redigering i formulärfält är möjlig.

// load Doc with an instance of Document
auto doc = System::MakeObject<Document>("input.doc");
// document protection only works when document protection is turned and only editing in form fields is allowed.
doc->Protect(ProtectionType::AllowOnlyFormFields, u"password");
// save the protected document.
doc->Save(u"Protected.Dot");  

Utforska MHTML konverteringsalternativ med C++

Konvertera MHTMLs till DOCM (Microsoft Word 2007 Marco File)
Konvertera MHTMLs till DOTM (Microsoft Word 2007+ Template File)
Konvertera MHTMLs till DOTX (Microsoft Word Template File)
Konvertera MHTMLs till FLATOPC (Microsoft Word 2003 WordprocessingML)
Konvertera MHTMLs till GIF (Graphical Interchange Format)
Konvertera MHTMLs till ODT (OpenDocument Text File Format)
Konvertera MHTMLs till OTT (OpenDocument Standard Format)
Konvertera MHTMLs till PCL (Printer Command Language Document)
Konvertera MHTMLs till PS (PostScript File)
Konvertera MHTMLs till RTF (Rich Text Format)
Konvertera MHTMLs till WORDML (Microsoft Word 2003 WordprocessingML)
Konvertera MHTMLs till CSV (Comma Seperated Values)
Konvertera MHTMLs till DIF (Data Interchange Format)
Konvertera MHTMLs till CSV (Comma Seperated Values)
Konvertera MHTMLs till FODS (OpenDocument Flat XML Spreadsheet)
Konvertera MHTMLs till MD (Markdown Language)
Konvertera MHTMLs till ODP (OpenDocument Presentation Format)
Konvertera MHTMLs till ODS (OpenDocument Spreadsheet)
Konvertera MHTMLs till OTP (OpenDocument Standard Format)
Konvertera MHTMLs till POT (Microsoft PowerPoint Template Files)
Konvertera MHTMLs till POTM (Microsoft PowerPoint Template File)
Konvertera MHTMLs till POTX (Microsoft PowerPoint Template Presentation)
Konvertera MHTMLs till PPT (Microsoft PowerPoint 97-2003)
Konvertera MHTMLs till PPS (PowerPoint Slide Show)
Konvertera MHTMLs till PPSM (Macro-enabled Slide Show)
Konvertera MHTMLs till PPSX (PowerPoint Slide Show)
Konvertera MHTMLs till PPT (Microsoft PowerPoint 97-2003)
Konvertera MHTMLs till PPTM (Macro-enabled Presentation File)
Konvertera MHTMLs till SWF (Shockwave Flash Movie)
Konvertera MHTMLs till SXC (StarOffice Calc Spreadsheet)
Konvertera MHTMLs till TSV (Tab Seperated Values)
Konvertera MHTMLs till XLAM (Excel Macro-Enabled Add-In)
Konvertera MHTMLs till XLSB (Excel Binary Workbook)
Konvertera MHTMLs till XLSM (Macro-enabled Spreadsheet)
Konvertera MHTMLs till XLT (Excel 97 - 2003 Template)
Konvertera MHTMLs till XLTM (Excel Macro-Enabled Template)