CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2016
    Posts
    4

    Convert PDF to Word in .NET with 2 Lines of Code

    With Aspose.Pdf for .NET - just add 2 lines of code and convert PDF files to Word Documents (DOC, DOCX) in .NET. The conversion is Fast, Accurate and Reliable and developers can easily manipulate Text, Tables, Images and other formatting.

    Code:
    Converting PDF to DOC
     
    The following code snippet shows the process of converting PDF file into DOC.
     
    C#
     
    // Open the source PDF document
    Document pdfDocument = new Document("input.pdf");
     
    // Save the file into a Microsoft document format
    pdfDocument.Save("D://pdftest//TableHeightIssue.doc", SaveFormat.Doc);
     
     
    VB.NET
     
    ' Open the source PDF document
    Dim pdfDocument As Document = New Document("input.pdf")
     
    ' Save the file into a Microsoft document format
    pdfDocument.Save("D://pdftest//TableHeightIssue.doc", SaveFormat.Doc)
     
    
    Converting PDF to DOCX
     
    C#
     
    // Open pdf document
    Document pdfDocument = new Document("source.pdf");
    // Instantiate DocSaveOptions object
    DocSaveOptions saveOptions = new DocSaveOptions();
    // Specify the output format as DOCX
    saveOptions.Format = DocSaveOptions.DocFormat.DocX;
    // Save document in docx format
    pdfDocument.Save("output.docx", saveOptions);
     
     
    VB.NET
     
    ' Open pdf document
    Dim pdfDocument As Document = New Document("source.pdf")
    ' Instantiate DocSaveOptions object
    Dim saveOptions As DocSaveOptions = New DocSaveOptions()
    ' Specify the output format as DOCX
    saveOptions.Format = DocSaveOptions.DocFormat.DocX
    ' Save document in DOCX format
    pdfDocument.Save("output.docx", saveOptions)
    Explore Aspose.PDF for .NET with numerous advanced PDF manipulation features.

    Regards,

    Usman Sarfraz

  2. #2
    Join Date
    Feb 2018
    Posts
    2

    Re: Convert PDF to Word in .NET with 2 Lines of Code

    Try using ZetPDF.com
    It worked for me perfectly!

    Best regards

    Fred Green

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured