Last active
April 15, 2025 01:08
-
-
Save conholdate-gists/7e52181e5c16bc9ab4944c4993d4a65a to your computer and use it in GitHub Desktop.
Convert PDF to Word using C#
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Initialize an object of the Document class and load the source PDF file | |
Document pdfDocument = new Document( "sample.pdf"); | |
// Save the file into DOC format by invoking Save method | |
pdfDocument.Save( "PDFToDOC_out.doc", SaveFormat.Doc); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/ Open the source PDF document by initializing an instance of Document class | |
Document pdfDocument = new Document( "sample.pdf"); | |
// Create an instance of DocSaveOptions class to access save options for export to Doc format | |
DocSaveOptions saveOptions = new DocSaveOptions | |
{ | |
// Set the value of this Format property to save the output file in Doc format. | |
Format = DocSaveOptions.DocFormat.Doc, | |
// Set the recognition mode as Flow by setting the Mode property | |
Mode = DocSaveOptions.RecognitionMode.Flow, | |
// Assign a value to the RelativeHorizontalProximity property Set the Horizontal proximity as 2.5 | |
RelativeHorizontalProximity = 2.5f, | |
// Enable the value to recognize bullets during conversion process by setting a value of RecognizeBullets property | |
RecognizeBullets = true | |
}; | |
// Invoke the Save method to save the file into MS document format | |
pdfDocument.Save( "PDFToDOC_out.doc", saveOptions); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment