We are converting a Word document which consists of Images to PDF using aspose API. But in the generated PDF, images were misplaced like coming on top of text content, which is not readable.
I have added optimization but that is causing the generated file to get damaged and unable to open it when using optimization.
Below are the optimization options used, once PDF generated unable to open it.
OptimizationOptions optimizationOptions = new OptimizationOptions();
public static SaveOutputParameters convertWordDocumentUsingAspose(String Source, String Destination) throws Exception {
//Load the Word document from Source
try
{
if("Y".equalsIgnoreCase(props.getString("ASPOSE_LICENSE"))){
com.aspose.words.License license= new com.aspose.words.License();
FileInputStream fis=new FileInputStream(props.getString("ASPOSE_LICENSE_PATH"));
license.setLicense(fis);
}
}
catch(Exception e) {
throw e;
}
/*
* orevious version code without password protected
Document doc = new Document(Source);
// Save as PDF at Destination
doc.save(Destination);
*/
Document doc = null;
try
{
doc = new Document(Source);
}
catch (Exception ex)
{
com.aspose.words.LoadOptions loadOps = new com.aspose.words.LoadOptions("");
doc = new Document(Source,loadOps);
}
// Save as PDF at Destination
doc.save(Destination);
// Save as PDF at Destination
SaveOutputParameters output = doc.save(Destination);
//return Document
return output;
}
I am working on your post, but I want to be precise.
You are using Aspose.Words API to convert to Pdf, and not Aspose.Pdf API.
I am asking because the forum is separated by API, and your question is not clear enough, even your code, since it is not using fully qualified names, I am not sure what type of document are you using.
So my first question is:
What Aspose API are you using for conversion from word to pdf?
@santhosh.utla
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.
Issue ID(s): PDFNET-54268
You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.
No problem. I will explain. The Java version of Aspose.Pdf API is generated automatically from the C# and then added some customs changes. Since this issue is presented in the C# version, too, it must be corrected there so it can propagate the fix to the Java version.
We create Java tickets only when the issue is not presented in the C# version and only happens in the Java version.