Quantcast
Channel: Ghostscript.NET
Viewing all articles
Browse latest Browse all 393

New Post: Send output to variable in place of file

$
0
0
I have the following code that simply converts the first page of a pdf to text.
        Dim gVER As GhostscriptVersionInfo = _
                    GhostscriptVersionInfo.GetLastInstalledVersion(Ghostscript.NET.GhostscriptLicense.GPL, _
                                                                   Ghostscript.NET.GhostscriptLicense.GPL)

        Dim gP As New Ghostscript.NET.Processor.GhostscriptProcessor(gVER, True)

        Dim Myargs As New List(Of String)
        With Myargs
            .Add("-q")
            .Add("-dSAFER")
            .Add("-dBATCH")
            .Add("-dNOPAUSE")
            .Add("-dNOPROMPT")
            .Add("-dFirstPage=1")
            .Add("-dLastPage=1")
            .Add("-sDEVICE=txtwrite")
            .Add("-sOutputFile=c:\MyFolder\output.txt")
            .Add("-fc:\MyFolder\hello.pdf")
        End With

        gP.Process(Myargs.ToArray)
After above is done, I have to read the output file back into a string variable.

Is there anyway to send the output into some kind of file stream variable in place of sending out to a text file? (I actually don’t need to keep nor want the text file).

Open to any suggestions.

Albert D. Kallal (Access MVP)
Edmonton, Alberta Canada

Viewing all articles
Browse latest Browse all 393

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>