Re: Pringing PDFs via ShellExecute from VFP

2021-07-02 Thread Philip Borkholder
Thanks Mike!

-- Original Message --
From: Mike 
To: profoxt...@leafe.com
Subject: Re: Pringing PDFs via ShellExecute from VFP
Date: Thu, 1 Jul 2021 17:19:55 -0500

This seems to be related to your need...at least the input from DSummZZZ.

https://www.tek-tips.com/viewthread.cfm?qid=85 


May need to sort through the output to find what you're looking for.

Mike



Philip Borkholder wrote:
> Hi all,
>
> I am currently printing VFP reports in sequence, then using ShellExecute to 
> print PDFs via their default program (Adobe DC).
> I am trying to keep each print job in sequence so they come out in the tray 
> together:
> Example:
>
> WO #1
> Drawings for WO #1 (PDF via ShellExecute)
>
> WO #2
> Drawings for WO #1 (PDF via ShellExecute)
>
> etc.
>
> What I'm running into is sometimes WO#2 prints out before WO#1's PDF prints 
> from Adobe DC.
>
> Does anyone have experience in using a Windows API to see if Adobe has 
> printed the PDF before I can continue printing my next VFP form?
>
> Thanks
>
> Philip B
> Bison Tech Plus
>
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/20210702.085231.245...@webmail03.dca.untd.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


RE: Pringing PDFs via ShellExecute from VFP

2021-07-02 Thread Philip Borkholder


Thanks Chris!

-- Original Message --
From: Chris Davis 
To: profoxt...@leafe.com
Subject: RE: Pringing PDFs via ShellExecute from VFP
Date: Fri, 2 Jul 2021 09:43:35 +

Hi Philip

I had the same problem recently and switched with success to 

http://www.columbia.edu/~em36/pdftoprinter.html

as sometimes we found adobe would leave itself open so any checks to see if it 
was still running couldn't be relied on.

Then using the following ShellExecute code ... you will notice my method on the 
form agcheckexe("pdftoprinter.exe"), I have included that code as well as this 
basically loops until any previous instances have finished before it launches 
again for the next PDF you want to queue up ...

&& PDF PRINT METHOD
LPARAMETERS lcfilename
lcfilename=ALLTRIM(TRANSFORM(lcfilename))

declare INTEGER ShellExecute in shell32 INTEGER handle, STRING @ oper, ;
STRING @ ifile, STRING @ iparam, STRING @ ipath, INTEGER showcmd

lcfile="c:\pdfprinter\pdftoprinter.exe"
lcpath=""

lcparam=["]+lcfilename+["]

DO WHILE thisform.agcheckexe("pdftoprinter.exe")
ENDDO

shellexecute(0,"open",lcfile,lcparam,lcpath,1)
=

&& AGCHECKEXE METHOD
LPARAMETERS tcName, tlTerminate
LOCAL loLocator, loWMI, loProcesses, loProcess, llIsRunning
loLocator   = CREATEOBJECT('WBEMScripting.SWBEMLocator')
loWMI   = loLocator.ConnectServer() 
loWMI.Security_.ImpersonationLevel = 3  && Impersonate

loProcesses = loWMI.ExecQuery([SELECT * FROM Win32_Process WHERE Name = '] 
+ tcName + ['])
llIsRunning = .F.
IF loProcesses.Count > 0
FOR EACH loProcess in loProcesses
llIsRunning = .T.
IF tlTerminate
loProcess.Terminate(0)
ENDIF
ENDFOR
ENDIF
RETURN llIsRunning


Regards

Chris

-Original Message-
From: ProfoxTech  On Behalf Of Philip Borkholder
Sent: 01 July 2021 20:55
To: profoxt...@leafe.com
Subject: Pringing PDFs via ShellExecute from VFP

Hi all,

I am currently printing VFP reports in sequence, then using ShellExecute to 
print PDFs via their default program (Adobe DC).
I am trying to keep each print job in sequence so they come out in the tray 
together:
Example:

WO #1
Drawings for WO #1 (PDF via ShellExecute)

WO #2
Drawings for WO #1 (PDF via ShellExecute)

etc.

What I'm running into is sometimes WO#2 prints out before WO#1's PDF prints 
from Adobe DC.

Does anyone have experience in using a Windows API to see if Adobe has printed 
the PDF before I can continue printing my next VFP form?

Thanks

Philip B
Bison Tech Plus

[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/20210702.085218.245...@webmail03.dca.untd.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.


Re: PDF printing on WINE & Win98

2021-07-02 Thread Man-wai Chang
printing - How do I print to PDF from wine? - Ask Ubuntu
https://askubuntu.com/questions/234336/how-do-i-print-to-pdf-from-wine

Other Google results:
https://www.google.com/search?q=linux+wine+pdf+creator

On Tue, Jun 29, 2021 at 6:14 PM Jürgen Wondzinski  wrote:
>
> Ok, now it's my turn for a problem solving:
>
> I inherited a customer, who runs a VFP6 app on a WINE on Linux setup. The 
> emulated Windows version is a Win98.
> The original developer and SysAdmin left the company. (After looking at the 
> codebase, I now know why)
> I was able to successfully recompile it in VFP9 and fix some idiotic things.
>
> Now the customer wants to print reports to PDF and then create an email (pure 
> text), attach that PDF and mail it by SMTP.
>
> All that without using the new printengine (that is slower than molasses on 
> that installation), and no COM object (since WINE is version 1.1.9 from 2006)
>
> Has anybody experience with a simple DLL only solution for that scenario?
>
> wOOdy
>
>
>
>
[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/CAGv=mjd+bw4eyom-vbsjieevejvyv8qjqfpuucijke0yaby...@mail.gmail.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.

RE: Pringing PDFs via ShellExecute from VFP

2021-07-02 Thread Chris Davis
Hi Philip

I had the same problem recently and switched with success to 

http://www.columbia.edu/~em36/pdftoprinter.html

as sometimes we found adobe would leave itself open so any checks to see if it 
was still running couldn't be relied on.

Then using the following ShellExecute code ... you will notice my method on the 
form agcheckexe("pdftoprinter.exe"), I have included that code as well as this 
basically loops until any previous instances have finished before it launches 
again for the next PDF you want to queue up ...

&& PDF PRINT METHOD
LPARAMETERS lcfilename
lcfilename=ALLTRIM(TRANSFORM(lcfilename))

declare INTEGER ShellExecute in shell32 INTEGER handle, STRING @ oper, ;
STRING @ ifile, STRING @ iparam, STRING @ ipath, INTEGER showcmd

lcfile="c:\pdfprinter\pdftoprinter.exe"
lcpath=""

lcparam=["]+lcfilename+["]

DO WHILE thisform.agcheckexe("pdftoprinter.exe")
ENDDO

shellexecute(0,"open",lcfile,lcparam,lcpath,1)
=

&& AGCHECKEXE METHOD
LPARAMETERS tcName, tlTerminate
LOCAL loLocator, loWMI, loProcesses, loProcess, llIsRunning
loLocator   = CREATEOBJECT('WBEMScripting.SWBEMLocator')
loWMI   = loLocator.ConnectServer() 
loWMI.Security_.ImpersonationLevel = 3  && Impersonate

loProcesses = loWMI.ExecQuery([SELECT * FROM Win32_Process WHERE Name = '] 
+ tcName + ['])
llIsRunning = .F.
IF loProcesses.Count > 0
FOR EACH loProcess in loProcesses
llIsRunning = .T.
IF tlTerminate
loProcess.Terminate(0)
ENDIF
ENDFOR
ENDIF
RETURN llIsRunning


Regards

Chris

-Original Message-
From: ProfoxTech  On Behalf Of Philip Borkholder
Sent: 01 July 2021 20:55
To: profoxt...@leafe.com
Subject: Pringing PDFs via ShellExecute from VFP

Hi all,

I am currently printing VFP reports in sequence, then using ShellExecute to 
print PDFs via their default program (Adobe DC).
I am trying to keep each print job in sequence so they come out in the tray 
together:
Example:

WO #1
Drawings for WO #1 (PDF via ShellExecute)

WO #2
Drawings for WO #1 (PDF via ShellExecute)

etc.

What I'm running into is sometimes WO#2 prints out before WO#1's PDF prints 
from Adobe DC.

Does anyone have experience in using a Windows API to see if Adobe has printed 
the PDF before I can continue printing my next VFP form?

Thanks

Philip B
Bison Tech Plus

[excessive quoting removed by server]

___
Post Messages to: ProFox@leafe.com
Subscription Maintenance: https://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: https://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: https://leafe.com/archives
This message: 
https://leafe.com/archives/byMID/loyp123mb3325f2252a0e2d9c4657db7f8f...@loyp123mb3325.gbrp123.prod.outlook.com
** All postings, unless explicitly stated otherwise, are the opinions of the 
author, and do not constitute legal or medical advice. This statement is added 
to the messages for those lawyers who are too stupid to see the obvious.