Click here to Skip to main content
15,887,683 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionC# 2010 linkage through master pages Pin
dcof29-Jun-12 19:38
dcof29-Jun-12 19:38 
AnswerRe: C# 2010 linkage through master pages Pin
Sandeep Mewara30-Jun-12 6:45
mveSandeep Mewara30-Jun-12 6:45 
GeneralRe: C# 2010 linkage through master pages Pin
dcof30-Jun-12 8:23
dcof30-Jun-12 8:23 
GeneralRe: C# 2010 linkage through master pages Pin
Sandeep Mewara1-Jul-12 1:38
mveSandeep Mewara1-Jul-12 1:38 
AnswerRe: C# 2010 linkage through master pages Pin
frostcox30-Jun-12 12:48
frostcox30-Jun-12 12:48 
QuestionHost server Characteristics Pin
WebMaster29-Jun-12 9:32
WebMaster29-Jun-12 9:32 
Generalxsl fo to xslt Pin
indian14329-Jun-12 8:37
indian14329-Jun-12 8:37 
GeneralTo save file in a stream instead of a physical location Pin
indian14329-Jun-12 5:58
indian14329-Jun-12 5:58 
Hi,

I my asp.net application I have to save a .doc file in to pdf file, so I am using the
Document.ExportAsFixedFormat method to convert and save as pdf. But it is storing only on to the disk in a physical location.

Is there any way that I can store output file pdf as a stream rather than in a physical location. Any kind of help would be really helpful please help me I am in a dire need.

If there is any alternate method available I am ready to accept it, any links or any advice is acceptable for me.

Thanks in advance. Below is my code.


Public Shared Function convertDoc2PDF(ByVal sourcePath As Object, ByVal targetPath As Object) As Boolean
        Dim result As Boolean
        Dim paramMissing As Object = Type.Missing
        Dim wordApplication As New ApplicationClass
        Dim wordDocument As Document = Nothing
        Try
            Dim paramSourceDocPath As Object = sourcePath
            Dim paramExportFilePath As String = targetPath
            Dim paramExportFormat As WdExportFormat = WdExportFormat.wdExportFormatPDF
            Dim paramOpenAfterExport As Boolean = False
            Dim paramExportOptimizeFor As WdExportOptimizeFor = WdExportOptimizeFor.wdExportOptimizeForPrint
            Dim paramExportRange As WdExportRange = WdExportRange.wdExportAllDocument
            Dim paramStartPage As Integer = 0
            Dim paramEndPage As Integer = 0
            Dim paramExportItem As WdExportItem = WdExportItem.wdExportDocumentContent
            Dim paramIncludeDocProps As Boolean = True
            Dim paramKeepIRM As Boolean = True
            Dim paramCreateBookmarks As WdExportCreateBookmarks = WdExportCreateBookmarks.wdExportCreateWordBookmarks
            Dim paramDocStructureTags As Boolean = True
            Dim paramBitmapMissingFonts As Boolean = True
            Dim paramUseISO19005_1 As Boolean = False
            wordDocument = wordApplication.Documents.Open( _
                                    paramSourceDocPath, paramMissing, True, _
                                    paramMissing, paramMissing, paramMissing, _
                                    paramMissing, paramMissing, paramMissing, _
                                    paramMissing, paramMissing, paramMissing, _
                                    paramMissing, paramMissing, paramMissing, _
                                    paramMissing)

            If (wordDocument IsNot Nothing) Then
                wordDocument.ExportAsFixedFormat(paramExportFilePath, _
                paramExportFormat, paramOpenAfterExport, _
                paramExportOptimizeFor, paramExportRange, paramStartPage, _
                paramEndPage, paramExportItem, paramIncludeDocProps, _
                paramKeepIRM, paramCreateBookmarks, paramDocStructureTags, _
                paramBitmapMissingFonts, paramUseISO19005_1, _
                paramMissing)
            End If
            result = True
        Catch ex As Exception
            result = False

        Finally

            If (wordDocument IsNot Nothing) Then
                wordDocument.Close(paramMissing, paramMissing, paramMissing)
                wordDocument = Nothing
            End If
            If (wordApplication IsNot Nothing) Then

                wordApplication.Quit(paramMissing, paramMissing, paramMissing)
                wordApplication = Nothing
            End If
            GC.Collect()
            GC.WaitForPendingFinalizers()
            GC.Collect()
            GC.WaitForPendingFinalizers()
        End Try

        Return result

    End Function

Thanks & Regards,

Abdul Aleem Mohammad
St Louis MO - USA


modified 29-Jun-12 12:30pm.

QuestionAutomatically Sychronize TFS workitems update with custom tool Pin
amit sahu2029-Jun-12 1:36
amit sahu2029-Jun-12 1:36 
QuestionCCTV camera on ASP web Page Pin
sandeep Nishad29-Jun-12 0:19
sandeep Nishad29-Jun-12 0:19 
AnswerRe: CCTV camera on ASP web Page Pin
Sandeep Mewara29-Jun-12 3:42
mveSandeep Mewara29-Jun-12 3:42 
Questionhow to sent mail using smtp.bizmail.yahoo.com Pin
gyanendragope28-Jun-12 23:42
gyanendragope28-Jun-12 23:42 
AnswerRe: how to sent mail using smtp.bizmail.yahoo.com Pin
Vani Kulkarni29-Jun-12 0:07
professionalVani Kulkarni29-Jun-12 0:07 
Questionweb form 2010 error Pin
classy_dog28-Jun-12 17:07
classy_dog28-Jun-12 17:07 
AnswerRe: web form 2010 error Pin
Sandeep Mewara28-Jun-12 22:16
mveSandeep Mewara28-Jun-12 22:16 
GeneralRe: web form 2010 error Pin
classy_dog29-Jun-12 3:18
classy_dog29-Jun-12 3:18 
GeneralRe: web form 2010 error Pin
Sandeep Mewara29-Jun-12 3:39
mveSandeep Mewara29-Jun-12 3:39 
QuestionGrid view binding in page load in 3tier Pin
prasadbhagat28-Jun-12 7:08
prasadbhagat28-Jun-12 7:08 
AnswerRe: Grid view binding in page load in 3tier Pin
R. Giskard Reventlov28-Jun-12 9:41
R. Giskard Reventlov28-Jun-12 9:41 
GeneralRe: Grid view binding in page load in 3tier Pin
Rajkumarhi528-Jun-12 19:22
Rajkumarhi528-Jun-12 19:22 
AnswerRe: Grid view binding in page load in 3tier Pin
Karthik Harve28-Jun-12 20:08
professionalKarthik Harve28-Jun-12 20:08 
AnswerRe: Grid view binding in page load in 3tier Pin
AshishChaudha29-Jun-12 22:26
AshishChaudha29-Jun-12 22:26 
AnswerRe: Grid view binding in page load in 3tier Pin
Rahul Rajat Singh29-Jun-12 22:54
professionalRahul Rajat Singh29-Jun-12 22:54 
Questionweb form staying active Pin
sc steinhayse28-Jun-12 5:30
sc steinhayse28-Jun-12 5:30 
AnswerRe: web form staying active Pin
Sandeep Mewara28-Jun-12 5:48
mveSandeep Mewara28-Jun-12 5:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.