🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: adobe.postscript.programming
6 messages
6 total messages Started by Robert Buster Tue, 05 Nov 2002 07:30
Can I convert PDF to PS with VBA
#1397
Author: Robert Buster
Date: Tue, 05 Nov 2002 07:30
1 lines
927 bytes
I'm looking for a way to convert PDF-files to PostScript automatically ( through VBA ). I've tries the Acrobat 5.0 type library but I can't find the exportPS function. Can someone help me?
Re: Can I convert PDF to PS with VBA
#1398
Author: Aandi Inston
Date: Tue, 05 Nov 2002 09:11
7 lines
1161 bytes
Did you just pick the name ExportPS, or is there a documentation
reference to it?   You should always use the SDK Reference materials
for Acrobat, but in fact I don't think there is any method for doing
this with VBA, except to have Acrobat print to a PostScript printer
ALREADY connected to a specific file port.

Aandi Inston
Re: Can I convert PDF to PS with VBA
#1399
Author: Sampada
Date: Tue, 05 Nov 2002 20:36
26 lines
2173 bytes
You can convert a pdf file to postscript file in VB. Add acrtobat.tlb in project reference.. here is a code 

Set lobjAdobeApp = CreateObject("AcroExch.App") 
Set lobjAdobeDoc = CreateObject("AcroExch.AVDoc") 

szDirPath = "c:\test\" '"C:\testpdf\" 
szFileName = "OutFile.ps" 
szPDFName = "env.PDF" '"TestFile.pdf" 



szTemp = szDirPath & Trim(szPDFName) ' full path to pdf file 
    lobjAdobeDoc.Open szTemp, szFileName 'open the file, with the final filename as the title of the window 
    If (lobjAdobeDoc.IsValid = True) Then ' we opened the document ok 
        Set lobjAdobePDDoc = lobjAdobeDoc.GetPDDoc() 
        nLastPage = lobjAdobePDDoc.GetNumPages() - 1 'Adobe is picky about having the correct page count. 
        lobjAdobeDoc.PrintPages 0, nLastPage, 1, 0, 0 'print the document to the default print driver 
        lobjAdobePDDoc.Close 'shut everything down nicely 
        lobjAdobeDoc.Close 0 
        'FileCopy "c:\RightFax.prn", szDirPath & Trim(szFileName) 'copy the new file to something your app understands 
        'Kill "c:\RightFax.prn" 'clean it out.. not necessary as the next print will overwrite, but I'm paranoid 
        MsgBox "Postscript file created successfully" 
    Else 
        'MsgBox "Could not open " & szPDFName & " in Acrobat" 'something VERY BAD has happened. 
        SendKeys "{ENTER}", True 
    End If
Re: Can I convert PDF to PS with VBA
#1271
Author: pleader
Date: Tue, 12 Nov 2002 13:54
6 lines
1077 bytes
Out of Curiosity, why would you want to do this? Autoconversion of PS files could be very dangerous if you're not dealing with a very controlled workflow, viz. page counts, page dimensions, orientation, printer setup. 

And PS files don't travel well (e.g. to other platforms) unless you really know what goes into them. 

Regards, 
Victor Lee.
Re: Can I convert PDF to PS with VBA
#1270
Author: Sampada
Date: Tue, 12 Nov 2002 14:30
2 lines
1265 bytes
We been using this code for 2 years now.. not a single time we had any problem!!! 
We had to do so because we deal with big pdf files having maps on few pages and text on few.. this was the only reliable option to convert pdf files to ps. The process has to be fully automated to send jobs to printers and fax servers based on business rules. After converting pdf files to ps files, we also edit ps files before sending to printers.. we have 3 different kinds of printers.. everything works just fine.
Re: Can I convert PDF to PS with VBA
#1279
Author: pleader
Date: Tue, 12 Nov 2002 22:44
4 lines
834 bytes
Well, in that case you probably have a "very controlled workflow". ;^) 

Regards, 
Victor Lee.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads