How to use aspose words in place of aspose pdf

Hi Team, Can you pls help me with this ?
My licence for aspose.pdf is done and i have to continue with aspose.words. I have a logic where i convert pdf byte array to pdf doc using aspose.pdf doc. Since i cannot use aspose pdf anymore, How can i convert byte array to pdf using aspose words. Please help.

@sugandhaaspose Please see our documentation to learn how to convert document to PDF:
https://docs.aspose.com/words/java/convert-a-document-to-pdf/
In your case you can load the document from InputStream and save it as PDF to OutputStream.

@alexey.noskov
This is my current code:

com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(pdfByteArray);
com.aspose.pdf.DocSaveOptions saveOptions = new com.aspose.pdf.DocSaveOptions();
saveOptions.setFormat(com.aspose.pdf.DocSaveOptions.DocFormat.DocX);

intermediateDocxFile = previewPdfFileLocation.replace(".pdf", ".docx");
pdfDocument.save(intermediateDocxFile, saveOptions);
pdfDocument.close();
return intermediateDocxFile;

Here i need to replace aspose.pdf with aspose.words as i cannot use aspose.pdf any more, How can i change the code here to remove dependency from aspose.pdf?

@sugandhaaspose Aspose.Words for Java does not support PDF to DOCX conversion. So you cannot replace Aspose.PDF with Aspose.Words here. Aspose.Words for Java supports DOCX to PDF conversion but not vice versa.

Hi Alexey,

Here is my current code where inuse aspose.pdf,

com.aspose.pdf.Document pdfDoc = new com.aspose.pdf.Document(byte [] arr);
com.aspose.pdf.DocSaveOptions saveOpt = new com.aspose.pdf.DocSaveOptions();
saveOpt.setFormat(com.aspose.DcoSaveOptions.DocFormat.Docx);
IntermediateFileDocx = file location.replace("pdf" , "docx");

I need to get rid of aspose pdf and here replace aspose.pdf with aspose.words .

Can you please suggest in reference to above code?

Regards,
Sugandha

@sugandhaaspose There is no way to achieve this using Aspose.Words. The provided code converts PDF to DOCX. Aspose.Words for Java does not support PDF to DOCX conversion.

Thanks for the response. Is there any other way
to achieve this?

@sugandhaaspose I am afraid the only way to convert PDF to DOCX in Java is using Aspose.PDF.