アプリケーションにドキュメント変換機能を追加しようとしているAndroid開発者ですか? Aspose.Total for Android via Java ファイル形式自動化ライブラリは、Androidアプリケーションでのドキュメント変換プロセスの自動化に役立ちます。 DOCMファイルをPPSMに変換するには、最初にドキュメント操作API Aspose.Words for Android via Java を使用してDOCMファイル形式をHTMLに変換できます。その後、PowerPoint API Aspose.Slides for Android Java を使用して、新しいプレゼンテーションを作成し、その中にHTMLコンテンツを書き込んで、名前を付けて保存できます。 PPSM。
AndroidでDOCMをPPSMに変換する方法
// 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からPPSMへの無料オンラインコンバーター
保護されたDOCMをJava経由でAndroidのPPSMに変換する
Androidアプリケーション内でパスワードで保護されたDOCMをPPSMに変換することもできます。入力DOCMドキュメントがパスワードで保護されている場合、パスワードを使用せずにPPSM形式に変換することはできません。暗号化されたドキュメントを開くには、LoadOptionsオブジェクトに正しいパスワードを設定し、それをDocumentコンストラクターに渡すことができます。
// 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 を PPSM に変換するにはどうすればよいですか?DOCM 変換オンライン アプリは、便宜上統合されています。 DOCM ファイルを PPSM に変換するには、DOCM ファイルをドラッグ アンド ドロップして白い領域に追加するか、領域内をクリックしてインポートします。その後、「変換」ボタンをクリックします。 DOCM から PPSM への変換が完了したら、変換されたファイルをワンクリックでダウンロードできます。
- DOCM の変換にはどのくらいの時間がかかりますか?このオンライン コンバーターの速度は、変換する DOCM ファイルのサイズに大きく依存します。小さな DOCM ファイルは、わずか数秒で PPSM に変換できます。ただし、変換コードを Android App アプリケーションに統合した場合、速度は変換プロセス用にアプリケーションをどれだけ最適化したかに依存します。
- 無料の Aspose.Total コンバーターを使用して DOCM を PPSM に変換しても安全ですか?もちろん!変換後、PPSM ファイルのダウンロード リンクがすぐに利用できるようになります。アップロードされたファイルは 24 時間後に自動的に削除され、この時間が経過するとダウンロード リンクは無効になります。他の誰もアクセスできないため、ファイルは安全ですのでご安心ください。 DOCM ファイルを含む当社のファイル変換サービスは完全に安全です。さらに、テスト用に無料のアプリが提供されており、コードを統合する前に結果を確認できます。
- DOCM を変換するには、どのブラウザを使用すればよいですか?Google Chrome、Firefox、Opera、Safari などの最新の Web ブラウザーは、このオンライン変換ツールと互換性があります。ただし、デスクトップ アプリケーションで作業している場合は、スムーズな操作のために Aspose.Total DOCM Conversion API をお勧めします。