คุณเป็นนักพัฒนา Android ที่ต้องการเพิ่มคุณสมบัติการแปลงเอกสารในแอปพลิเคชันของคุณหรือไม่? Aspose.Total for Android via Java ไลบรารีระบบอัตโนมัติของรูปแบบไฟล์ช่วยให้คุณทำกระบวนการแปลงเอกสารในแอปพลิเคชัน Android ได้โดยอัตโนมัติ ในการแปลงไฟล์ DOCM เป็น PPTM ขั้นแรก คุณสามารถใช้ API การจัดการเอกสาร Aspose.Words for Android Java เพื่อแปลงรูปแบบไฟล์ DOCM เป็น HTML ได้ หลังจากนั้นโดยใช้ PowerPoint API Aspose.Slides for Android Java คุณสามารถสร้างงานนำเสนอใหม่ เขียนเนื้อหา HTML ในนั้น และบันทึกเป็น อปท.
วิธีแปลง DOCM เป็น PPTM ใน Android
ข้อกำหนดการแปลง
สำหรับการแปลงไฟล์ DOCM เป็น PPTM คุณสามารถใช้ Aspose.Total for Android via Java ได้โดยตรงจาก Maven และติดตั้งไลบรารีในแอปของคุณ
หรือคุณสามารถรับไฟล์ ZIP จาก ดาวน์โหลด
// 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); |
ตัวแปลงออนไลน์ฟรีสำหรับ DOCM เป็น PPTM
แปลง DOCM ที่ได้รับการป้องกันเป็น PPTM ใน Android ผ่าน Java
คุณยังสามารถแปลง DOCM ที่ป้องกันด้วยรหัสผ่านเป็น PPTM ภายในแอปพลิเคชัน Android ของคุณ หากเอกสาร DOCM ที่คุณป้อนมีการป้องกันด้วยรหัสผ่าน คุณจะไม่สามารถแปลงเป็นรูปแบบ PPTM ได้โดยไม่ต้องใช้รหัสผ่าน ในการเปิดเอกสารที่เข้ารหัส คุณสามารถตั้งรหัสผ่านที่ถูกต้องในออบเจกต์ LoadOptions และส่งผ่านไปยังตัวสร้างเอกสาร
// 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); |
คำถามที่พบบ่อย
- ฉันจะแปลง DOCM เป็น PPTM ออนไลน์ได้อย่างไรแอพแปลง DOCM ออนไลน์นั้นรวมไว้ด้านบนเพื่อความสะดวกของคุณ หากต้องการแปลงไฟล์ DOCM เป็น PPTM เพียงเพิ่มไฟล์ DOCM ของคุณโดยการลากและวางลงในพื้นที่สีขาวหรือคลิกภายในพื้นที่เพื่อนำเข้า หลังจากนั้นคลิกที่ปุ่ม "แปลง" เมื่อการแปลง DOCM เป็น PPTM เสร็จสิ้น คุณสามารถดาวน์โหลดไฟล์ที่แปลงแล้วได้ในคลิกเดียว
- การแปลง DOCM ใช้เวลานานเท่าไหร่?ความเร็วของตัวแปลงออนไลน์นี้ขึ้นอยู่กับขนาดของไฟล์ DOCM ที่คุณต้องการแปลงเป็นส่วนใหญ่ ไฟล์ DOCM ขนาดเล็กสามารถแปลงเป็น PPTM ได้ในเวลาเพียงไม่กี่วินาที อย่างไรก็ตาม หากคุณรวมรหัสการแปลงเข้ากับแอปพลิเคชัน Android App ของคุณ ความเร็วจะขึ้นอยู่กับว่าคุณปรับแอปพลิเคชันของคุณให้เหมาะสมสำหรับกระบวนการแปลงได้ดีเพียงใด
- การแปลง DOCM เป็น PPTM ปลอดภัยหรือไม่โดยใช้ตัวแปลง Aspose.Total ฟรีแน่นอน! หลังจากแปลงแล้ว ลิงก์ดาวน์โหลดไฟล์ PPTM ของคุณจะใช้งานได้ทันที ไฟล์ที่อัปโหลดจะถูกลบโดยอัตโนมัติหลังจากผ่านไป 24 ชั่วโมง และลิงก์ดาวน์โหลดจะใช้งานไม่ได้หลังจากเวลานี้ มั่นใจได้ว่าไฟล์ของคุณจะปลอดภัย เพราะไม่มีใครสามารถเข้าถึงได้ บริการแปลงไฟล์ของเรา ซึ่งรวมถึงไฟล์ DOCM นั้นปลอดภัยอย่างสมบูรณ์ นอกจากนี้ แอปฟรียังมีไว้สำหรับการทดสอบ ให้คุณยืนยันผลลัพธ์ก่อนที่จะรวมโค้ด
- ฉันควรใช้เบราว์เซอร์ใดในการแปลง DOCMเว็บเบราว์เซอร์สมัยใหม่ เช่น Google Chrome, Firefox, Opera และ Safari เข้ากันได้กับเครื่องมือแปลงออนไลน์นี้ อย่างไรก็ตาม หากคุณกำลังทำงานบนแอปพลิเคชันบนเดสก์ท็อป ขอแนะนำให้ใช้ Aspose.Total DOCM Conversion API เพื่อการทำงานที่ราบรื่น