Hi
I’m testing some docxs documents with both Aspose.Words versions 18.5 and 19.1. The issue is that the Aspose.Words save function never returns. This is my testing code:
public class Test01
{
public static void main(String[] args)
{
// testing:
Path wiki_path = Paths.get("D:\\OFICIO DGM quiruvilca VF 24012019_.docx");
try
{
byte[] wikiArray = Files.readAllBytes(wiki_path);
Test01 oef = new Test01();
byte[] outFile = oef.pdfConverter(wikiArray);
Path path = Paths.get("D:\\sample.pdf");
Files.write(path, outFile);
}
catch (Exception e)
{
System.out.println(e);
}
}
public byte[] pdfConverter(byte[] archivo) throws IOException, Exception
{
License license = new com.aspose.words.License();
license.setLicense("Aspose.Words.lic");
// Save the document in PDF format.
try (OutputStream out = new ByteArrayOutputStream())
{
// Load the document from disk.
try (InputStream fis = new ByteArrayInputStream(archivo))
{
Document doc = new Document(fis);
PdfSaveOptions options = new PdfSaveOptions();
options.setDisplayDocTitle(false);
options.setCompliance(PdfCompliance.PDF_15);
doc.save(out, options);
}
return ((ByteArrayOutputStream)out).toByteArray();
}
}
}
This also happens with this docx file:
https://www.dropbox.com/s/x25rlb01ax8hond/2332681_RevisedManuscript_JBP_02_01_16.docx.zip?dl=0
This is a sample file provided in this discussion about a similar issue:
Java version: JDK 1.8.191
OS: Windows 10 x64.
I’m attaching my file that causes this problem:
OFICIO DGM quiruvilca VF 24012019_.zip (216.6 KB)