imags text file(like *.pdf,*.Tiff,.*gif,*.jpeg,*.jpg files) convert into word text file using .NET

Posted by Rmohankumar under VB.NET on 11/17/2011 | Points: 10 | Views : 3371 | Status : [Member] | Replies : 3
how to Convert any imags text file(like *.pdf,*.Tiff,.*gif,*.jpeg,*.jpg files) into word text file using VB.NET or C#.Net, help me with source code




Responses

Posted by: Rebecca Yang on: 9/27/2013 [Member] Starter | Points: 25

Up
0
Down
Viewing the following code which is used to convert image into word by using Spire.DOC :http://www.download366.com/spire-doc?utm_source=google&utm_medium=cpc&utm_campaign=366_USA_en_longtail_Productividad&utm_content=Spire.Doc&utm_term=spire%20doc&gclid=CIbI9qmE67kCFUXhQgodPxsAcA

{C#}
using System.Drawing;
using Spire.Doc;
using Spire.Doc.Documents;
using Spire.Doc.Fields;

namespace WordImage
{
class ImageinWord
{
static void Main(string[] args)
{
//Create Document
Document document = new Document();
Section s = document.AddSection();
Paragraph p = s.AddParagraph();

//Insert Image and Set Its Size
DocPicture Pic = p.AppendPicture(Image.FromFile(@"E:\Work\Documents\SampleImage\Sample.jpg"));
Pic.Width = 750;
Pic.Height = 468;

//Save and Launch
document.SaveToFile("Image.docx", FileFormat.Docx);
System.Diagnostics.Process.Start("Image.docx");
}
}
}



{visual Basic}

Imports Spire.Xls
Imports Spire.Pdf
Imports Spire.Xls.Converter

Namespace ExceltoPDF
Class Program
Private Shared Sub Main(args As String())
' load Excel file
Dim workbook As New Workbook()
workbook.LoadFromFile("D:\test.xlsx")

' Set PDF template
Dim pdfDocument As New PdfDocument()
pdfDocument.PageSettings.Orientation = PdfPageOrientation.Landscape
pdfDocument.PageSettings.Width = 970
pdfDocument.PageSettings.Height = 850

'Convert Excel to PDF using the template above
Dim pdfConverter As New PdfConverter(workbook)
Dim settings As New PdfConverterSettings()
settings.TemplateDocument = pdfDocument
pdfDocument = pdfConverter.Convert(settings)

' Save and preview PDF
pdfDocument.SaveToFile("sample.pdf")
System.Diagnostics.Process.Start("sample.pdf")
End Sub
End Class
End Namespace




Rmohankumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Thomas128 on: 3/19/2014 [Member] Starter | Points: 25

Up
0
Down
As far as I know, there is not such converter to directly turn an image into a Word doc. However, you can use the OCR technology to extract the content from your pictures and then export to a Word doc. Here's is a simple guide that might help :) http://www.yiigo.com/guides/vbnet/how-to-ocr.shtml


Today is a gift. That's why it's called the Present!

Rmohankumar, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Evanpan on: 3/4/2016 [Member] Starter | Points: 25

Up
0
Down
Hi,
I wonder do you have any suggetion about pdf extraction process? Any suggestion will be appreciated. Thanks in advance. ( http://www.pqscan.com/extract-text/ )



Best regards,
Pan



Rmohankumar, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response