Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I convert .doc in .docx #108

Open
KatRRina opened this issue May 13, 2024 · 2 comments
Open

How can I convert .doc in .docx #108

KatRRina opened this issue May 13, 2024 · 2 comments

Comments

@KatRRina
Copy link

KatRRina commented May 13, 2024

I use this code:

public DocumentDto parseDocument(byte[] docBytes){
        try {
            ByteArrayInputStream docStream = new ByteArrayInputStream(docBytes);
            ByteArrayOutputStream outputStream = new ByteArrayOutputStream();

            Document doc = new Document(docStream);
            doc.updateWordCount();
            doc.save(outputStream, SaveFormat.DOCX);
            // Получаем массив байт из ByteArrayOutputStream
            byte[] resultBytes = outputStream.toByteArray();
            DocxParser docxParser = new DocxParser();
            DocumentDto result = docxParser.parseDocument(resultBytes);
            result.setFormat(getDocumentType());
            docStream.close();
            outputStream.close();
            return result;
        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }

but after the line Document doc = new Document(docStream);, there are 7 pages left in the 150-page document

@KatRRina KatRRina changed the title How can I convert .doc in .doxc How can I convert .doc in .docx May 13, 2024
@AlexNosk
Copy link

@KatRRina Most likely, this occurs because you are using Aspose.Words in evaluation mode. There two limitations in the free evaluation version of Aspose.Words:

  • An evaluation watermark is injected in the documents.
  • The maximum size of the processed document is limited to several hundreds of paragraphs.

Please see our documentation for more information:
https://docs.aspose.com/words/java/licensing/

If you would like to test Aspose.Words without evaluation version limitations, you can request a free 30-days temporary license .

@KatRRina
Copy link
Author

@KatRRina Most likely, this occurs because you are using Aspose.Words in evaluation mode. There two limitations in the free evaluation version of Aspose.Words:

  • An evaluation watermark is injected in the documents.
  • The maximum size of the processed document is limited to several hundreds of paragraphs.

Please see our documentation for more information: https://docs.aspose.com/words/java/licensing/

If you would like to test Aspose.Words without evaluation version limitations, you can request a free 30-days temporary license .

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants