importcom.aspose.pdf.Document;importcom.aspose.pdf.Page;importcom.aspose.pdf.TextFragment;publicclassMainActivityextendsAppCompatActivity{@OverrideprotectedvoidonCreate(Bundle savedInstanceState){super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);// 创建 PDF 文档Document pdfDoc =newDocument();Page page = pdfDoc.getPages().add();TextFragment text =newTextFragment("Hello, Aspose PDF on Android!"); page.getParagraphs().add(text);// 保存为文件 pdfDoc.save(getExternalFilesDir(null)+"/output_aspose.pdf");}}