We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose.Words for Android

I would like to put two documents into a pdf document, but it takes a long time.how can I shorten the time. Here's my code.

Document doc = new Document(templateFile.getPath());
Document docx = new Document(otherFile.getPath());
...
doc.appendDocument(docx, ImportFormatMode.KEEP_SOURCE_FORMATTING);
...
FontSettings.getDefaultInstance().setFontsFolder(PreviewTemplateHelper.getAssetsFile().getPath(), true);
FontSettings.getDefaultInstance().setDefaultFontName("MS YaHei");
doc.save(file.getPath());
wkdlihu:
I would like to put two documents into a pdf document, but it takes a long time.how can I shorten the time. Here's my code.
The time it takes to add a lot of pictures to a pdf file is very long.
Document doc = new Document(templateFile.getPath());
Document docx = new Document(otherFile.getPath());
...
doc.appendDocument(docx, ImportFormatMode.KEEP_SOURCE_FORMATTING);
...
FontSettings.getDefaultInstance().setFontsFolder(PreviewTemplateHelper.getAssetsFile().getPath(), true);
FontSettings.getDefaultInstance().setDefaultFontName("MS YaHei");
doc.save(file.getPath());

I want to convert two .dot files into a PDF file and add a lot of pictures to the document. However, it takes a long time to generate a PDF file.

How can i reduce the time spent.
Document doc = new Document(“fileName”);
Document docx = new Document(“otherFile”);
doc.appendDocument(docx, ImportFormatMode.KEEP_SOURCE_FORMATTING);
FontSettings.getDefaultInstance().setFontsFolder(PreviewTemplateHelper.getAssetsFile().getPath(), true);
FontSettings.getDefaultInstance().setDefaultFontName(“MS YaHei”);
doc.save(file.getPath());
Hi,

Thanks for your inquiry. To ensure a timely and accurate response, please attach the following resources here for testing:

  • Your input Word documents
  • Aspose.Words generated output PDF file
  • Font file(s) used in Word document e.g. MS YaHei
  • Please create a standalone Android application (source code without compilation errors) that helps us reproduce your specific problem on our end and attach it here for testing.

As soon as you get these pieces of information ready, we'll start further investigation into your issues and provide you more information. Thanks for your cooperation.

PS: To attach these resources, please zip them and Click 'Reply' button that will bring you to the 'reply page' and there at the bottom you can include any attachments with that post by clicking the 'Add/Update' button.

Best regards,

Annex is my program source code, please pay attention to check.

Hi,

Thanks for the additional information.

After an initial test with licensed version of 'Aspose.Words for Android via Java' 17.5, we were unable to reproduce this issue on our end on a real device. The whole process ended in just under 5 seconds. However, we do see garbage characters in generated PDF (see attachment). This is probably because of missing Fonts. Please ZIP and attach following Font files here for further testing

  • MS YaHei
  • 宋体

Best regards,