hi guys ,
hope you are all fine.

i want to created MS word doc file to pdf file converter in MS Visual Studio 2005..
can any one help me what will be the procedure to develop such a thing?

Waiting for good reply...

Asif Javaid Chughtai.

To get a good reply, start with a good question. What steps have you already taken? Are you familiar with the PDF spec? Are you willing to use a 3rd party library? If so, COM or .NET? What's your budget?

The HTML to PDF Converter library for .NET 2.0 or the RTF to PDF converter for .NET from Winnovative Software is a good option. The integration with your ASP.NET application should be instant. There are samples for windows forms, ASP.NET and console both in C# and VB.NET that should help.


You can download it from http://www.dotnet-reporting.com (or from http://www.winnovative-software.com is the same).


The converter has also some interesting new features like the possiblity to encrypt/password protect your document, pdf merge capabilities, etc. All the conversion can be performed with a few lines of code:

PdfConverter pdfConverter = new PdfConverter();
// set the converter options
pdfConverter.PdfDocumentOptions.PdfPageSize = PdfPageSize.A4;
pdfConverter.PdfDocumentOptions.PdfCompressionLevel = PdfCompressionLevel.Normal;
pdfConverter.PdfDocumentOptions.PdfPageOrientation = PDFPageOrientation.Portrait;
pdfConverter.PdfDocumentOptions.ShowHeader = false;
pdfConverter.PdfDocumentOptions.ShowFooter = false;

// Performs the conversion and get the pdf document bytes that you can further
// save to a file or send as a browser response
byte[] pdfBytes = pdfConverter.GetPdfFromUrlBytes(urlToConvert);

// send the PDF document as a response to the browser for download
System.Web.HttpResponse response = System.Web.HttpContext.Current.Response;
response.Clear();
response.AddHeader("Content-Type", "binary/octet-stream");
response.AddHeader("Content-Disposition",
"attachment; filename=ConversionResult.pdf; size=" + pdfBytes.Length.ToString());
response.Flush();
response.BinaryWrite(pdfBytes);
response.Flush();
response.End();

Comments
great find/post

Hi,

You may try "UseOffice .Net" library to convert Word, PowerPoint, Excel to PDF in C# and VB.Net. It requires a installed MSoffice, but the quality of the expense of converting a very hight. :-/
Use this code:

SautinSoft.UseOffice u = new SautinSoft.UseOffice();
	//Prepare UseOffice .Net, loads MS Word in memory
	int ret = u.InitWord();			

	//Return values:
	//0 - Loading successfully
	//1 - Can't load MS Word® library in memory 

	if (ret==1)
		return;
			
	//Convert DOC to PDF
	u.ConvertFile(@"c:\Word.doc", "c:\Adobe.pdf", SautinSoft.UseOffice.eDirection.DOC_to_PDF);
	u.CloseWord();

Good luck!
Magnet.

Edited 5 Years Ago by Magnet Peterson: link

This article has been dead for over six months. Start a new discussion instead.