Is it possible to perform actions like remove hidden text, strip macros etc from a pdf document using aspose.word

i have aspose 20.2, is it possible to perform actions like remove hidden text, strip macros etc in a pdf document using aspose.word

@saheeraeranhikkal yes it is possible modify PDF documents using Aspose.Words API, but please notice some observations:

  1. Try to stay up to date with the latest versions of the Aspose API. We periodically release new versions that solve bugs and improve the API’s behavior and performance.
  2. The Aspose.Words API was designed to work with ‘flow documents’, while PDFs are considered ‘fixed documents’. Therefore, if you load a PDF using the Aspose.Words API, it will attempt to convert the document (which is a fixed document) into a flow document. Sometimes, this conversion process is not straightforward and may result in undesired outcomes. If you need to work with PDF documents, we recommend using the Aspose.Pdf API instead.

does aspose.pdf requires separate license ? also when i tried to read multipart file (which is a pdf) as a document i got below exception
“Pdf format is not supported on this platform. Use .NET Standard version of Aspose.Words for loading Pdf documents.”

new Document(file.getInputStream())

@saheeraeranhikkal if you are using Java (as I think), please notice that load PDF using Aspose.Words for Java is not supported.
You can get separated license for Aspose individual products or get an Aspose Total license which include all the products in Aspose catalog.

yes, we are using aspose.word for java, so you mean to say that aspose.word for java does not support reading pdf documents???and the only way is to get the license for aspose.pdf?

or is there any latest version of aspose.word does support pdf ?

@saheeraeranhikkal Java version of Aspose.Words does not support loading PDF documents. This feature request is logged as WORDSJAVA-2366 and is not yet scheduled for development.

So at the moment, the only way to process PDF document in Java is used Aspose.PDF.

@saheeraeranhikkal load PDF files is not supported in any version of Aspose.Words for Java.
The only options are get a license for Aspose.Pdf, or use Aspose.Words for .NET or Python to load the file and convert it in a memory stream to be processed later by your Java application (notice that load PDF/A documents are not supported for Aspose.Words in any language).

Thank you,

Can i convert docx to pdf, so save the bytes as a pdf document in java ? because when i do that am getting null pointer exception

ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
document.save(outputStream, SaveFormat.pdf);

@saheeraeranhikkal Please provide you input document here for testing. Let’s continue with this issue is another your thread here.