Hi Every body
I am Developing a web site that will Convert word doc to pdf almost i have don it but word file styles are not Converted into Pdf how can i do that please help me
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Suthish NairRank #92 · 22.8K reputationPosted Mar 2, 2011, 8:44 AM EST
msdn forum
Mohd Ali18 reputationPosted Mar 2, 2011, 8:21 PM EST
Mohd Ali18 reputationPosted Mar 2, 2011, 9:00 PM EST
Error 2 'Microsoft.Office.Interop.Word.WdSaveFormat' does not contain a definition for 'wdFormatPDF' E:\ExcelSheetConverterSite\WordFile.aspx.cs 112 72 E:\ExcelSheetConverterSite\
Suthish NairRank #92 · 22.8K reputationPosted Mar 2, 2011, 10:20 PM EST
Suthish NairRank #92 · 22.8K reputationPosted Mar 2, 2011, 10:28 PM EST
Hirendra SisodiyaRank #258 · 9.8K reputationPosted Mar 2, 2011, 10:44 PM EST
so check that...
Mohd Ali18 reputationPosted Mar 3, 2011, 1:05 AM EST
using Microsoft.Office.Interop.Word; every thing is working Proper but that method is not working wdFormatPDF; i am getting error like that
Error 2 'Microsoft.Office.Interop.Word.WdSaveFormat' does not contain a definition for 'wdFormatPDF' E:\ExcelSheetConverterSite\WordFile.aspx.cs 112 72 E:\ExcelSheetConverterSite\
Suthish NairRank #92 · 22.8K reputationPosted Mar 3, 2011, 8:23 AM EST
Link1 Link2
Mohd Ali18 reputationPosted Mar 3, 2011, 8:49 PM EST
Suthish NairRank #92 · 22.8K reputationPosted Mar 3, 2011, 10:06 PM EST
Mohd Ali18 reputationPosted Mar 4, 2011, 1:18 AM EST
Suthish NairRank #92 · 22.8K reputationPosted Mar 4, 2011, 2:40 AM EST
Suthish NairRank #92 · 22.8K reputationPosted Mar 4, 2011, 9:15 AM EST
which Operating System using?
MS 2007
MS 2010
Use Application instead of Application Class
Microsoft.Office.Interop.Word.Application WordApp = new Microsoft.Office.Interop.Word.Application();
Refer my article with samples attached:
http://www.c-sharpcorner.com/uploadfile/suthish_nair/2906/
karthi keyan2 reputationPosted Nov 18, 2012, 9:31 PM EST
plz find the attachment and resolve the "value out of range" issue soon...........
Chestertonpdf Chesterton20 reputationPosted Apr 7, 2014, 8:15 PM EDT
Dim PDF As New RasterEdgeImaging() Public Sub WordConvertToPdf() If True Then WordInputFile = ("C:/1.docx") ImageOutputFile = ImageFormat.pdf End If End Sub doc.Save(@"C:/1.docx", 1, @"C:/1.pdf")Nicholas Barns12 reputationPosted Apr 28, 2014, 1:40 AM EDT
You will notice after the publishing of your website some issues may occur, as described on the above link.
I would suggest you to try this C# word automation alternative, I found it's quite easy to use.
Here is how you could use it:
string filePath = Server.MapPath(GetFileName()); var doc1 = DocumentModel.Load(filePath); // Here the word content is copeied into a string which helps to store it into textbox. string m_Content = doc1.Content.Text; string fldName = "~/TampFiles/"; string Path = Server.MapPath(fldName + "Result.pdf"); doc1.Save(Path);Kip HackmanRank #2,595 · 536 reputationPosted May 21, 2020, 5:17 AM EDT
You can use LEADTOOLS Document Imaging SDK technology in your application.
https://www.leadtools.com/sdk/document/document-converter
Here is some sample code:
Leon DRank #851 · 2.6K reputationPosted May 21, 2020, 4:17 PM EDT