Do you own a Debenu Quick PDF Library version 7, 8, 9, 10, 11, 12, 13 or iSEDQuickPDF license? Upgrade to Debenu Quick PDF Library 14 today!

Debenu Quick PDF Library - PDF SDK Community Forum Homepage
Forum Home Forum Home > For Users of the Library > I need help - I can help
  New Posts New Posts RSS Feed - Need to Convert PS to PDF
  FAQ FAQ  Forum Search   Register Register  Login Login

Need to Convert PS to PDF

 Post Reply Post Reply
Author
Message
stevengupta View Drop Down
Beginner
Beginner


Joined: 27 Dec 10
Location: Va
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevengupta Quote  Post ReplyReply Direct Link To This Post Topic: Need to Convert PS to PDF
    Posted: 27 Dec 10 at 6:10PM
I am trying to convert out a postscript file to a PDF file.

I am using the code below.

When it comes to the save portion I end up with a blank PDF file.

Any ideas?

    Public Sub ConvertPS(ByVal PsFile As String)

        Dim OutputPDF As String

        Dim psReader As String

        OutputPDF = Replace(UCase(PsFile), ".PS", ".PDF")

        If File.Exists(OutputPDF) Then
            Kill(OutputPDF)
        End If

        Dim objSR As New StreamReader(PsFile)
        psReader = objSR.ReadToEnd
        objSR.Close()

        Dim PDFLibrary As QuickPDFAX0723.PDFLibrary
        PDFLibrary = CreateObject("QuickPDFAX0723.PDFLibrary")
        If PDFLibrary.UnlockKey("YOUR KEY HERE!") = 1 Then

            Dim psO = PDFLibrary.NewPostScriptXObject(psReader)
            Dim i = PDFLibrary.DrawPostScriptXObject(psO)
            PDFLibrary.SaveToFile(OutputPDF)
            PDFLibrary.RemoveDocument(PDFLibrary.SelectedDocument)

        End If

        PDFLibrary = Nothing


    End Sub
Back to Top
BEvans View Drop Down
Beginner
Beginner
Avatar

Joined: 07 Nov 10
Status: Offline
Points: 5
Post Options Post Options   Thanks (0) Thanks(0)   Quote BEvans Quote  Post ReplyReply Direct Link To This Post Posted: 30 Dec 10 at 5:56PM
Embedding raw postscript in a PDF isn't the same as converting a PS file to a PDF. Some PDF viewers won't even show it. In general you print such files to a PDF virtual printer of some kind or use Acrobat Distiller / GhostScript or something equivalent on them directly.

Some links that might be useful:
Using Acrobat Distiller to convert PS to PDF
Tools to convert to/from PS
Back to Top
stevengupta View Drop Down
Beginner
Beginner


Joined: 27 Dec 10
Location: Va
Status: Offline
Points: 2
Post Options Post Options   Thanks (0) Thanks(0)   Quote stevengupta Quote  Post ReplyReply Direct Link To This Post Posted: 01 Jan 11 at 7:23PM
Thanks for the reply.
I think you are saying that quick pdf will not convert a ps file to a PDF file.

I was previously using acrobat distiller com object, but after moving from 8.0 to acrobat 9.0 the distiller com object does not work correctly unless the user running the command is actually logged into the terminal server. Under 8.0 it didn't require that.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 11.01
Copyright ©2001-2014 Web Wiz Ltd.

Copyright © 2017 Debenu. Debenu Quick PDF Library is a PDF SDK. All rights reserved. AboutContactBlogSupportOnline Store