Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Print2PDF

Status
Not open for further replies.

NeedERP

IS-IT--Management
Mar 9, 2004
15
US
Does anyone have experience in working with the Print2PDF program that automatically converts Visual FoxPro Reports into PDF files?

I have several programs that call the Print2PDF.prg, and they all work fine. I have just written another program which calls the Print2PDF.prg and it is giving me problems.

When the Print2PDF.prg tries to delete the .ps file and rename the PDF file, I get a sharing violation. It looks like Adobe is still trying to create the PDF file when Print2PDF tries to delete and rename.

I posted this question in the Adobe forum with no success. Any assistance would be appreciated.
 
Hi
Print2PDF is in regular use and I dont find any problem. I dont remember exactly where I did some modification, but I did something to integrate into mine for some auto installation of Ghostscript drivers, in case, the users dont have them installed. It just asks for a couple of pressing YES by the users and it goes smooth all the time.

Unless you are specific to the issues, may be we will find that difficult to answer with generality. :)

____________________________________________
ramani - (Subramanian.G) :)
 
I have using the Jaws PDF printer driver
(then it was the %d PDF printer driver) for a while.
This drivers lets your output the pdf files to a directory.
Usally I set the printer to the PDF, then print the jobs,
But you need to have the pdf driver installed on each computer.

Where can I get a copy of PRINT2PDF.prg
(or buy?)
 
flintstone42

Where can I get a copy of PRINT2PDF.prg

Try using your favorite internet search engine using PRINT2PDF as a keyword...





Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Take a look at thread184-367933

It may be that you are using winexec rather than createprocess in yuor code.

HTH

 
I stumbled across the solution to my problem on another message board today. You need to leave a 1/2" margin around the outside of the report when using Print2PDF or the distiller stops responding. I moved the right most fields in the report designer just a fraction to the left and now the report works fine. I am posting this information incase anyone else encounters a similar situation.
 
When the Print2PDF.prg tries to delete the .ps file and rename the PDF file, I get a sharing violation. It looks like Adobe is still trying to create the PDF file when Print2PDF tries to delete and rename.

I had a similar problem using Rick Strahl's pdf wwpdf class. I tried to delete the unused files, but Acrobat was still using them.

I added a loop to check and make sure each ps file had a pdf file associated with it, and the filesize was greater than 0. That indicated acrobat was done processing the file.

With some work, this may fit your needs.

Code:
lcPath  = "Path to PDF Files"
WAIT WINDOW NOWAIT "Waiting for Acrobat to complete & release all files."
DO WHILE .T.
  llWaitLonger = .F.
  lnPDFCount = ADIR(arTemp,lcPath + '*.PDF')
  IF lnPDFCount >= pnPDFCount 
    * pnCount is totaled (added) in each individual routine
    FOR lni = 1 TO pnPDFCount
      IF arTemp[lni,2] = 0
        llWaitLonger = .T.
      ENDIF
    ENDFOR
  ELSE
    llWaitLonger = .T.	
  ENDIF
	
  IF llWaitLonger = .F.
    * terminate do-while
    EXIT
  ENDIF
ENDDO

DO deleteFiles

Jim Osieczonek
Delta Business Group, LLC
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top