Hi Support team,
I have used the below method to convert Docx to PDF, but it saves with empty file.
I am using a small word file to convert to pdf with the below code.
Can any one help me to get it solved.
public static void exportToPdf(File tempPdfFile, byte[] bytes){
try {
InputStream is = new ByteArrayInputStream(bytes);
LoadOptions loadOptions = new LoadOptions();
loadOptions.setLoadFormat(LoadFormat.DOCX);
Document doc = new Document(is, loadOptions);
doc.save(new FileOutputStream(tempPdfFile),
com.aspose.words.SaveFormat.PDF);
} catch (Exception e) {
//Exception
}
}
@satishpadakanti,
Please ZIP and upload your input Word document and Aspose.Words generated PDF file showing the undesired behavior here for testing. We will then investigate the issue on our end and provide you more information.
Hi Hafeez,
Now I am able to generate the file with Content, is it possible to generate the PDF with out any water mark.
If Yes can you please share me sample code to delete the watermark.
Thanks,
@satishpadakanti,
To remove the watermark from a document you have to set only the name of watermark shape during inserting and then remove watermark shape by assigned name. The code snippets mentioned in the following article show you how to set the name of watermark shape and then remove from the Word document.
How to Remove Watermark from a Document
Hi Hafeez,
Is it possible to remove the water mark image which generated by Aspose and the text which generated “Evaluation Only. Created with Aspose.Words. Copyright 2003-2019 Aspose Pty Ltd.” and “Created with an evaluation copy of Aspose.Words. To discover the full versions of our APIs
please visit: Professional On-Premise and Cloud-based solutions for working with Word document formats”
@satishpadakanti,
The evaluation version of Aspose.Words for Java (without a license specified) provides full product functionality, but there are a few limitations; for example, it inserts an evaluation watermark at the top of the document on open and save, and limits the maximum document size to several hundred paragraphs.
If you want to test Aspose.Words for Java without the evaluation version limitations, you can also request a 30-day Temporary License. Please refer to How to get a Temporary License?
Also, please check: