Hi,
I am using aspose-pdf-16.11.0 to convert pdf to doc document.
Below is the sample code:
public void generateDocReport() {
try {
// Create license object
com.aspose.pdf.License license = new com.aspose.pdf.License();
// Load the license file into FileStream object
InputStream licence = new FileInputStream(new File(“E://Reports//Aspose.Pdf.lic”));
license.setLicense(licence);
// Load source PDF file
InputStream reportDoc = new FileInputStream(new File(“E://Reports//Assessment Summary.pdf”));
com.aspose.pdf.Document pdfDocument = new com.aspose.pdf.Document(reportDoc);
com.aspose.pdf.DocSaveOptions saveOptions = new com.aspose.pdf.DocSaveOptions();
// Set output file format as DOCX
saveOptions.setFormat(com.aspose.pdf.DocSaveOptions.DocFormat.Doc);
// Save resultant DOCX file
pdfDocument.save(“E://Reports//Assessment Summary Doc.doc”, saveOptions);
reportDoc.close();
} catch (Exception e) {
throw new RuntimeException(“Error thrown while generating doc using Aspose.pdf.”
+ e.getLocalizedMessage(), e);
}
}
After running above program “Assessment Summary Doc.doc” file generates successfully. However there are formatting issues. Please open the attached generated doc file and go to page number 4. There look at the formatting of last row “Workload, Cost Optimized 3-yr”, text are cut from the top. Also spacing is missing between words on table header ComputeStorageNetwork".
Please resolve this ASAP and let me know.
I am attaching both Assessment Summary.pdf and generated
Assessment Summary Doc.doc file.
Thanks
Kamal Sethiya
Hi Kamal,
Hi,
I am facing one more issue related to style when converting pdf to doc. I am attaching Comparison Report.pdf for input to program and Comparison Report.doc file generated after conversion. Please go to page number 5 of Comparison Report.doc file. There if you see first and second table’s 2nd and 3rd row data; alignment is not correct (data for Total and Compute sub herder is not aligned with other data on same row). Also spacing is missing between sub header (<!–[if gte mso 9]>
<w:WordDocument>
<w:View>Normal</w:View>
<w:Zoom>0</w:Zoom>
<w:TrackMoves/>
<w:TrackFormatting/>
<w:PunctuationKerning/>
<w:ValidateAgainstSchemas/>
<w:SaveIfXMLInvalid>false</w:SaveIfXMLInvalid>
<w:IgnoreMixedContent>false</w:IgnoreMixedContent>
<w:AlwaysShowPlaceholderText>false</w:AlwaysShowPlaceholderText>
<w:DoNotPromoteQF/>
<w:LidThemeOther>EN-US</w:LidThemeOther>
<w:LidThemeAsian>X-NONE</w:LidThemeAsian>
<w:LidThemeComplexScript>X-NONE</w:LidThemeComplexScript>
<w:Compatibility>
<w:BreakWrappedTables/>
<w:SnapToGridInCell/>
<w:WrapTextWithPunct/>
<w:UseAsianBreakRules/>
<w:DontGrowAutofit/>
<w:SplitPgBreakAndParaMark/>
<w:DontVertAlignCellWithSp/>
<w:DontBreakConstrainedForcedTables/>
<w:DontVertAlignInTxbx/>
<w:Word11KerningPairs/>
<w:CachedColBalance/>
</w:Compatibility>
<w:BrowserLevel>MicrosoftInternetExplorer4</w:BrowserLevel>
<m:mathPr>
<m:mathFont m:val=“Cambria Math”/>
<m:brkBin m:val=“before”/>
<m:brkBinSub m:val="–"/>
<m:smallFrac m:val=“off”/>
<m:dispDef/>
<m:lMargin m:val=“0”/>
<m:rMargin m:val=“0”/>
<m:defJc m:val=“centerGroup”/>
<m:wrapIndent m:val=“1440”/>
<m:intLim m:val=“subSup”/>
<m:naryLim m:val=“undOvr”/>
</m:mathPr></w:WordDocument>
<![endif]–><span style=“font-size:14.0pt;mso-bidi-font-size:11.0pt;
font-family:UDJIGA+Roboto-Regular;mso-fareast-font-family:Calibri;mso-hansi-font-family:
Calibri;mso-bidi-font-family:“Times New Roman”;color:#00A6FF;letter-spacing:
.15pt;mso-ansi-language:EN-US;mso-fareast-language:EN-US;mso-bidi-language:
AR-SA”>ComputeStorageNetwork<!–[if gte mso 10]>
<![endif]–>).
will be resolved? Actually without above fixes we won’t be able to release
one of the major feature on our product. We are using aspose.pdf OEM
licence.
Thanks
Hi Kamal,
Hi Kamal,
Thanks for your patience.
We are pleased to share that the issue reported earlier as PDFJAVA-36444, is resolved in latest release of Aspose.Pdf for Java 17.7. Please try using the latest release version and in case you encounter any issue or you have any further query, please feel free to contact.