C++ API för att exportera XPS till DOTM

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

 

Aspose.Total for C++ filformatsautomatiseringsbibliotek tillåter C++-utvecklare att konvertera XPS till DOTM i två enkla steg. För det första kan du använda Aspose.PDF for C++ API för att konvertera XPS-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 DOTM.

C++ API för att rendera XPS till DOTM

  1. Öppna XPS-filen med klassreferens Document
  2. Konvertera XPS 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 DOTM-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 XPS file with an instance of Document class reference
auto doc = MakeObject<Document>(u"sourceFile.xps");
// save XPS 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 Dotm
wordDoc->Save(u"output.Dotm");  

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

I processen att rendera XPS till DOTM kan du öppna en lösenordsskyddad XPS och även ändra dess lösenord. För att ändra lösenordet för en XPS-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 XPS Document
auto doc = MakeObject<Document>(L"input.xps", L"owner");
// change password of XPS Document
doc->ChangePasswords(L"owner", L"newuser", L"newuser");
// save the document
doc->Save(L"output.Doc");

Begränsa DOTM-filredigering via C++

Du kan också begränsa redigering av DOTM-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.Dotm");  

Utforska XPS konverteringsalternativ med C++

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