2X faster development
The ultimate WPF UI toolkit to boost your development speed.
The PDF document can be converted to Word document by exporting the PDF document pages as images using PDF library and then the exported images can be added to the WordDocument using the DocIO Library. Please find the code snippet and sample for the same from below link,
Code Snippet: //Creates a new Word document. WordDocument m_wordDocument = new WordDocument(); //Adds new section to the document. IWSection section = m_wordDocument.AddSection(); //Sets the page margins to zero. section.PageSetup.Margins.All = 0; //Adds new paragraph to the section. IWParagraph firstParagraph = section.AddParagraph(); SizeF defaultPageSize = new SizeF(m_wordDocument.LastSection.PageSetup.PageSize.Width, m_wordDocument.LastSection.PageSetup.PageSize.Height); //Loads the PDF document from the given file path. using (PdfLoadedDocument m_loadedDocument = new PdfLoadedDocument(m_filePath)) { for (int i = 0; I < m_loadedDocument.Pages.Count ; i++) { //Exports the PDF document page as image with the given size. using (Image image = m_loadedDocument.ExportAsImage(i, defaultPageSize,false)) { //Adds image to the paragraph IWPicture picture = firstParagraph.AppendPicture(image); //Sets width and height for the image. picture.Width = image.Width; picture.Height = image.Height; } } }; //Saves the Word document m_wordDocument.Save("Save.docx"); //Close the document. m_wordDocument.Dispose();
Sample Link: http://www.syncfusion.com/downloads/support/directtrac/general/ze/PDFToWordSample-1317895491.zip Note: Since we have achieved the PDF document to Word document by exporting the images from the PDF document, we cannot edit the converted Word document.
|
2X faster development
The ultimate WPF UI toolkit to boost your development speed.
This page will automatically be redirected to the sign-in page in 10 seconds.