Hello,
I am trying to take a PDF and save it as a Word 2010 compliant docx file. My main goal is to have it so the PDF can be opened in 2010 (or other office version) without opening in compatibility mode. I have this working, however the resulting docx file ends up being almost 2.5MB, even though the initial PDF was only 3KB (and was empty for the most part). Below is the code I’m using. I take the initial 3kb PDF and save it to docx with Aspose PDF, which results in a file size of 19KB. I then open that file with Aspose Words, set the compliance mode and save format, and save that file. The result can be opened in 2010 without being in compatibility mode, but results in a 2.5MB file. Is there an option I may be missing that is causing the file size to increase so much? Or a different way to go from PDF to compliant docx so it’s not in compatibility mode?
Thanks!
Richard
Aspose.Pdf.License license = new Aspose.Pdf.License();
license.SetLicense(“Aspose.Total.lic”);
Aspose.Pdf.Document pdfDoc = new Aspose.Pdf.Document(@“c:\temp\SmallPDF.pdf”); // file size is 3KB
Aspose.Pdf.DocSaveOptions saveOptions = new Aspose.Pdf.DocSaveOptions();
saveOptions.Format = Aspose.Pdf.DocSaveOptions.DocFormat.DocX;
saveOptions.Mode = Aspose.Pdf.DocSaveOptions.RecognitionMode.Flow;
saveOptions.RelativeHorizontalProximity = 2.5f;
saveOptions.RecognizeBullets = true;pdfDoc.Save(@“c:\temp\PdfToDocxResult.docx”, saveOptions); // this file size ends up 19KB
Aspose.Words.License wordLicense = new Aspose.Words.License();
wordLicense.SetLicense(“Aspose.Total.Lic”);Aspose.Words.Document wordDoc = new Aspose.Words.Document(@“c:\temp\PdfToDocxResult.docx”);
Aspose.Words.Saving.OoxmlSaveOptions options = null;options = new Aspose.Words.Saving.OoxmlSaveOptions(Aspose.Words.SaveFormat.Docx);
options.Compliance = Aspose.Words.Saving.OoxmlCompliance.Iso29500_2008_Transitional;
wordDoc.Save(@“c:\temp\NewDocx.docx”, options); // file size ends up 2,245KB