אפליקציית המרה מקוונת של DOTX ל-ODP וקוד Java להמרת קבצי DOTX

פתח אפליקציית המרה וייצוא המבוססת על Java רבת עוצמה DOTX. המר קבצי DOTX בודדים או מרובים ל-ODP ופורמטים אחרים באמצעות Java Automation API. המרה חופשית של קבצי DOTX באופן מקוון באמצעות אפליקציה עם הורדה מיידית.

המר קבצים מקוונים של DOTX ל-ODP באמצעות אפליקציה

  1. העלה קבצים DOTX להמרה
  2. המתן מספר שניות או יותר בהתאם לגודל DOTX
  3. עקוב אחר שורת המצב של העלאה
  4. לחץ על כפתור “המר”.
  5. DOTX יומר למסמך ODP
  6. הורד את קובץ ה-ODP שהומר

המר את DOTX ל-ODP באמצעות Java Automation API

  1. פתח קובץ DOTX באמצעות מחלקת Document
  2. המר קובץ DOTX ל-HTML באמצעות שיטת save
  3. אתחול אובייקט Presentation חדש
  4. חלץ תוכן מקובץ HTML באמצעות BufferedReader וכתוב את התוכן בקובץ המצגת שלך
  5. שמור את המסמך ב-ODP בשיטת save
 

קוד Java עבור המרה של DOTX ל-ODP

// supports DOC, DOCX, DOT, DOTM, DOTX, FLATOPC, ODT, OTT, RTF, TXT, WORDML, DOCM input file formats
// load DOC file with an instance of Document
Document document = new Document("template.doc");
// save the document in HTML file format
document.save("HtmlOutput.html",SaveFormat.HTML);
// create a new presentation
Presentation pres = new Presentation();
// access the default first slide of presentation
ISlide slide = pres.getSlides().get_Item(0);
// add the AutoShape to accommodate the HTML content
IAutoShape ashape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 10, 10,
(float) pres.getSlideSize().getSize().getWidth(),
(float) pres.getSlideSize().getSize().getHeight());
ashape.getFillFormat().setFillType(FillType.NoFill);
// add text frame to the shape
ashape.addTextFrame("");
// clear all paragraphs in added text frame
ashape.getTextFrame().getParagraphs().clear();
// initialize StringBuilder to read Html
StringBuilder contents = new StringBuilder();
// load HTML file by using BufferedReader
BufferedReader reader = new BufferedReader(new FileReader(new File("HtmlOutput.html")));
String text = null;
// repeat until all lines are read
while ((text = reader.readLine()) != null) {
contents.append(text).append(System.getProperty("line.separator"));
}
reader.close();
// add HTML content in text frame
ashape.getTextFrame().getParagraphs().addFromHtml(content);
// supports POTM, POT, POTX, PPSM, PPS, PPSX, PPTM, PPT, PPTX, ODP output file formats.
// save presentation as Pptx
pres.save("output.pptx", com.aspose.slides.SaveFormat.Pptx);
 
 

עוד כמה מקרים לשמירת DOTX ב-ODP עם תכונות אחרות כמו.

// supports DOC, DOT, DOCX, DOCM, DOTX, and DOTM file formats
// load DOC file with an instance of Document
Document document = new Document("template.doc", new LoadOptions("MyPassword"));
// save the document in HTML file format
document.save("HtmlOutput.html",SaveFormat.HTML);
// create a new presentation
Presentation pres = new Presentation();
// perform the conversion to PPT

// supports DOC, DOCX, DOT, DOTM, DOTX, FLATOPC, ODT, OTT, RTF, TXT, WORDML, DOCM input file formats
// load DOC file with an instance of Document
Document document = new Document("template.doc");
// save the document in HTML file format
document.save("HtmlOutput.html",SaveFormat.HTML);
// create a new presentation
Presentation pres = new Presentation();
// access the default first slide of presentation
ISlide slide = pres.getSlides().get_Item(0);
// add the AutoShape to accommodate the HTML content
IAutoShape ashape = slide.getShapes().addAutoShape(ShapeType.Rectangle, 10, 10,
(float) pres.getSlideSize().getSize().getWidth(),
(float) pres.getSlideSize().getSize().getHeight());
ashape.getFillFormat().setFillType(FillType.NoFill);
// add text frame to the shape
ashape.addTextFrame("");
// clear all paragraphs in added text frame
ashape.getTextFrame().getParagraphs().clear();
// initialize StringBuilder to read Html
StringBuilder contents = new StringBuilder();
// load HTML file by using BufferedReader
BufferedReader reader = new BufferedReader(new FileReader(new File("HtmlOutput.html")));
String text = null;
// repeat until all lines are read
while ((text = reader.readLine()) != null) {
contents.append(text).append(System.getProperty("line.separator"));
}
reader.close();
// add HTML content in text frame
ashape.getTextFrame().getParagraphs().addFromHtml(content);
// add watermark
IAutoShape ashp = slide.getShapes()
.addAutoShape(ShapeType.Rectangle,50, 50, 500, 500);
ashp.addTextFrame("Watermark Text");
ashp.getTextFrame().getParagraphs().get_Item(0).getPortions()
.get_Item(0).getPortionFormat().getFillFormat()
.setFillType(FillType.Solid);
ashp.getTextFrame().getParagraphs().get_Item(0).getPortions()
.get_Item(0).getPortionFormat().getFillFormat()
.getSolidFillColor().setColor(Color.GRAY);
ashp.getTextFrame().getParagraphs().get_Item(0).getPortions()
.get_Item(0).getPortionFormat().setFontHeight(25);
// Change the line color of the rectangle to White
ashp.getShapeStyle().getLineColor().setColor(Color.WHITE);
ashp.getShapeStyle().setLineStyleIndex(LineStyle.ThinThin);
// Remove any fill formatting in the shape
ashp.getFillFormat().setFillType(FillType.NoFill);
ashp.setRotation(-45);
ashp.getAutoShapeLock().setSelectLocked(true);
ashp.getAutoShapeLock().setSizeLocked(true);
ashp.getAutoShapeLock().setTextLocked(true);
ashp.getAutoShapeLock().setPositionLocked(true);
ashp.getAutoShapeLock().setGroupingLocked(true);
// supports POTM, POT, POTX, PPSM, PPS, PPSX, PPTM, PPT, PPTX, ODP output file formats.
// save presentation as Pptx
pres.save("output.pptx", com.aspose.slides.SaveFormat.Pptx);

 

פתח יישום המרת קבצים DOTX באמצעות Java

צריך לפתח יישום תוכנה מבוסס Java כדי לשמור ולייצא בקלות קבצי DOTX למסמך ODP? עם Aspose.Total for Java , כל מפתח Java יכול לשלב את קוד ה-API לעיל כדי לתכנת את אפליקציית ההמרה במגוון פורמטים כולל Microsoft Word (DOC, DOCX), Excel (XLS, XLSX), Powerpoint (PPT, PPTX), PDF, קבצי דוא"ל, תמונות (JPG, PNG, BMP, GIF) ופורמטים אחרים. ספריית Java רבת עוצמה להמרת מסמכים, תומכת בפורמטים פופולריים רבים כולל פורמט DOTX. ייצוא ועיבוד מסמכים לפורמטים אחרים, מתכנתים יכולים להשתמש ב-Aspose.Total for Java ילד API כולל Aspose.Words for Java , Aspose.Cells for Java , Aspose.Slides for Java , Aspose.PDF for Java , Aspose.Imaging for Java ועוד.

DOTX ספריית המרות עבור Java

ישנן אפשרויות חלופיות לשילוב Aspose.Total for Java במערכת שלך. אנא בחר אחד שדומה לצרכים שלך ופעל לפי ההוראות המפורטות:

  • השתמש ב-Aspose.Total for Java ישירות מפרויקט מבוסס Maven וכלול צאצא API רלוונטי ב-pom.xml.
  • לחלופין, אפשר לקבל קובץ ZIP מ- הורדות .

שומר את DOTX ל-ODP דרישות האפליקציה

כל מערכת הפעלה שיכולה להריץ את Java Runtime Environment (JRE) יכולה להריץ Aspose.Total for Java. הרשימות הבאות לרוב, אך לא כולן, מערכות הפעלה נתמכות.

  • Microsoft Windows
  • לינוקס: אובונטו, OpenSUSE, CentOS ואחרים
  • macOS: 10.9 (Mavericks) ואילך
  • נייד: אנדרואיד, iOS

ַחקוֹר DOTX אפשרויות המרה עם Java

להמיר DOTX ל CSV (Comma Seperated Values)
להמיר DOTX ל DIF (Data Interchange Format)
להמיר DOTX ל Excel (Spreadsheet File Formats)
להמיר DOTX ל FODS (OpenDocument Flat XML Spreadsheet)
להמיר DOTX ל JSON (JavaScript Object Notation File)
להמיר DOTX ל ODS (OpenDocument Spreadsheet)
להמיר DOTX ל POT (Microsoft PowerPoint Template Files)
להמיר DOTX ל POTM (Microsoft PowerPoint Template File)
להמיר DOTX ל POTX (Microsoft PowerPoint Template Presentation)
להמיר DOTX ל Powerpoint (Presentation Files)
להמיר DOTX ל PPS (PowerPoint Slide Show)
להמיר DOTX ל PPSM (Macro-enabled Slide Show)
להמיר DOTX ל PPSX (PowerPoint Slide Show)
להמיר DOTX ל PPT (PowerPoint Presentation)
להמיר DOTX ל PPTM (Macro-enabled Presentation File)
להמיר DOTX ל PPTX (Open XML presentation Format)
להמיר DOTX ל SXC (StarOffice Calc Spreadsheet)
להמיר DOTX ל TSV (Tab-separated Values)
להמיר DOTX ל XLAM (Excel Macro-Enabled Add-In)
להמיר DOTX ל XLS (Microsoft Excel Binary Format)
להמיר DOTX ל XLSB (Excel Binary Workbook)
להמיר DOTX ל XLSM (Macro-enabled Spreadsheet)
להמיר DOTX ל XLSX (Open XML Workbook)
להמיר DOTX ל XLT (Excel 97 - 2003 Template)
להמיר DOTX ל XLTM (Excel Macro-Enabled Template)
להמיר DOTX ל XLTX (Excel Template)