Alaska Software Inc. - Re: oPdf:LoadFile() : once more
Username: Password:
AuthorTopic: Re: oPdf:LoadFile() : once more
Olaf870Re: oPdf:LoadFile() : once more
on Tue, 15 Jan 2008 22:52:37 +0100
Hello Frans,
you did not write, which pdf-control do you use. And a former thread from 
you which answers this question I could not found.
regards
Olaf
Frans Vermeulen Re: oPdf:LoadFile() : once more
on Wed, 16 Jan 2008 13:04:37 +0100
Hi Olaf,

I did use the acrobat activex-control.
In the meantime I have decided to abandon it,
it's lame.

There is no way to guarantee that a document 
is actually printed. There is no way to detect 
whether or not a pdf is printed completely.
Every 10 prints the printer starts to print 
binary, resulting in half a tree of paper being
filled with crap. Every x-times Acrord32.exe produces
errors without notification to the caller.
Acrobat-activex is a horror.

I decided to install ghostscript and ghostview.
http://pages.cs.wisc.edu/~ghost/

My code now looks like this:

///----------------------------------------------------------------------------
Function PrintPdfBestand(cFileNaam, nKopieen)
///----------------------------------------------------------------------------
   Local lPrinted    :=TRUE
   Local cBaseNaam   :=BaseFileNaam(cFileNaam)

   Default nKopieen To 1

   lPrinted:=(RunShell('-all -copies '+Var2Char(nKopieen)+;
                       ' -printer "\\srv3\HPPlanning" "'+cFileNaam+;
                       '"', "c:\program files\ghostgum\gsview\gsprint.exe",;
                       FALSE, TRUE)==0)
   If !(DosError()==0)
      EmailPrintLog("Pdf", cBaseNaam, DosErrorMessage(),  lPrinted)
   Else
      EmailPrintLog("Pdf", cBaseNaam, "",  lPrinted)
   EndIf
   If lPrinted
      KillFile(cFileNaam)
   EndIf
Return lPrinted

You can probably guess what the functions
EmailPrintLog and BaseFileNaam look like.
I still have to make the printername ("\\srv3\HPPlanning")
variable.

This code runs without a single problem for 3 consecutive weeks now.

Regards,
Frans Vermeulen

BTW, where were you at the devcon?
Now I still owe you a beer, for the outlook security solution!