Free Support Forum - aspose.com

Docx -> pdf conversion issue: save function takes infinite amount of time to convert docx file


#1

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 oefa = new Test01();
            byte[] outFile = oefa.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)


#2

@yelinna

Thanks for your inquiry. We have tested the scenario and have managed to reproduce the same issues at our side. For the sake of correction, we have logged these problems in our issue tracking system.

The issue ID for this document is WORDSNET-18091.

The issue ID for this document is WORDSNET-18092.

You will be notified via this forum thread once these issues are resolved. We apologize for your inconvenience.


#3

Thanks for the reply.
After more testing on versions 18.5 and 19.1, I found out that the Aspose.Words function updateFields() has the same problem with the two docx documents in this thread: it never returns.


#4

@yelinna

Thanks for sharing the detail. We have managed to reproduce the same issue for both documents at our end. We have logged this detail in our issue tracking system.

Please let us know if you have any more queries.


#5

Did you solve the problem? How can I track the issues WORDSNET-18092 and WORDSNET-18091?


#6

@yelinna

Thanks for your inquiry. Unfortunately, these issues are not resolved yet and there is no ETA available at the moment. We will inform you via this forum thread once these issues are resolved. We apologize for your inconvenience.